I tried experimenting with a fancy new HTML5 client SQL database for my options page. It's really cool. But, I'm not quite seeing how to best retrieve my user options from the DB.
Anyone know if it's possible to give my content script access to the option page's DB?
As far as I know you can't directly access your extension's SQL database directly from a content script. Instead you'll need to use some sort of message passing to ask your extension for the setting information you need: http://code.google.com/chrome/extensions/messaging.html
> I tried experimenting with a fancy new HTML5 client SQL database for > my options page. It's really cool. But, I'm not quite seeing how to > best retrieve my user options from the DB.
> Anyone know if it's possible to give my content script access to the > option page's DB?
> As far as I know you can't directly access your extension's SQL database > directly from a content script. Instead you'll need to use some sort of > message passing to ask your extension for the setting information you > need:http://code.google.com/chrome/extensions/messaging.html
> Colin
> On 1/20/2010 17:26, GeorgesMouth wrote:
> > I tried experimenting with a fancy new HTML5 client SQL database for > > my options page. It's really cool. But, I'm not quite seeing how to > > best retrieve my user options from the DB.
> > Anyone know if it's possible to give my content script access to the > > option page's DB?
> On Jan 20, 6:30 pm, Colin Bleckner <co...@xmarks.com> wrote:
> > As far as I know you can't directly access your extension's SQL database > > directly from a content script. Instead you'll need to use some sort of > > message passing to ask your extension for the setting information you > > need:http://code.google.com/chrome/extensions/messaging.html
> > Colin
> > On 1/20/2010 17:26, GeorgesMouth wrote:
> > > I tried experimenting with a fancy new HTML5 client SQL database for > > > my options page. It's really cool. But, I'm not quite seeing how to > > > best retrieve my user options from the DB.
> > > Anyone know if it's possible to give my content script access to the > > > option page's DB?
Yea...thats what I am hoping... Right now my background page consists of about 30 lines of code just sending the options from the localStorage to the content script...
On Jan 21, 3:17 pm, GeorgesMouth <geo...@gadgetopolis.com> wrote:
> Thanks. That's cool. Though a slick shared DB/storage solution via Bug > 30224 would be way cooler.
> On Jan 20, 6:12 pm, hexid <nick.curr...@gmail.com> wrote:
> > Yes, for the time being you need to use message passing to get the > > data from the options page...
> > You can star this bughttp://code.google.com/p/chromium/issues/detail?id=30224 > > to get notices on the status of direct variable and localstorage usage > > between background/options/popup pages and the content scripts...
> > On Jan 20, 6:30 pm, Colin Bleckner <co...@xmarks.com> wrote:
> > > As far as I know you can't directly access your extension's SQL database > > > directly from a content script. Instead you'll need to use some sort of > > > message passing to ask your extension for the setting information you > > > need:http://code.google.com/chrome/extensions/messaging.html
> > > Colin
> > > On 1/20/2010 17:26, GeorgesMouth wrote:
> > > > I tried experimenting with a fancy new HTML5 client SQL database for > > > > my options page. It's really cool. But, I'm not quite seeing how to > > > > best retrieve my user options from the DB.
> > > > Anyone know if it's possible to give my content script access to the > > > > option page's DB?
I've played around with this a little. I found that I could create a database from the content script or the background script but they were mutually inaccessible, and the popup script could access neither - I wrongly assumed that the popup script would be able to share more with the background script than seems to be the case. At present my app uses messages from the content script to the background script and vice-versa because I plan to use (background-only) cross-site scripting to store/retrieve information on a central server (possibly a google app). I would like the content script to provide summary information and maintenance functions ( delete old information - how big can a database be?).
My (buggy) extension uses a database to cache comments and postings on a certain blog on which comments and posts frequently disappear without explanation; It tries to restore and hilite disappeared comments (and, in the future, whole posts). I plan to extend it to allow the deletions to be shared with other users. The source is available via a general intro here: http://www.antievolution.org/cgi-bin/ikonboard/ikonboard.cgi?act=ST;f.... I haven't added it to the google repository because it may be seen as a little bit "mean-spirited" there.
Remember, if you created db within the content script, it would be the db for that url page not the extension. The best way to do what you want is do what Colin recommended.
On Thu, Jan 21, 2010 at 8:25 PM, steve_h <howarth.st...@gmail.com> wrote: > I've played around with this a little. I found that I could create a > database from the content script or the background script but they > were mutually inaccessible, and the popup script could access neither > - I wrongly assumed that the popup script would be able to share more > with the background script than seems to be the case. At present my > app uses messages from the content script to the background script and > vice-versa because I plan to use (background-only) cross-site > scripting to store/retrieve information on a central server (possibly > a google app). I would like the content script to provide summary > information and maintenance functions ( delete old information - how > big can a database be?).
> My (buggy) extension uses a database to cache comments and postings on > a certain blog on which comments and posts frequently disappear > without explanation; It tries to restore and hilite disappeared > comments (and, in the future, whole posts). I plan to extend it to > allow the deletions to be shared with other users. The source is > available via a general intro here:
> -- > You received this message because you are subscribed to the Google Groups > "Chromium-extensions" group. > To post to this group, send email to chromium-extensions@googlegroups.com. > To unsubscribe from this group, send email to > chromium-extensions+unsubscribe@googlegroups.com<chromium-extensions%2Bunsu bscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/chromium-extensions?hl=en.