Thanks esquifit! Can you please tell me how to use GM_setValue() to read the value from that opened tab? When I see syntax it was showing to read into variable but from where it has to set the variable is not given.
On Mon, May 24, 2010 at 7:41 PM, esquifit <[email protected]> wrote: > On Mon, May 24, 2010 at 5:46 AM, jyothi panidarapu > <[email protected]> wrote: > > You mean to say I should add the file location also to the script (in GM > to > > apply this script to this location also). > > If so unless I open the location, is the script going to work for that > file > > url? > > Yes. If you don't make use of 'external' tools (for ex. java), a > usescript can only read > a) the content of a loaded page > b) information retrieved via HttpXmlRequest (or GM_httpxmlRequest) > c) values stored as preferences via GM_setValue > > and nothing else. As for b, access to file:/// urls via > GM_httpxmlRequest is disabled by security reasons, as far as I can > remember, though I haven't test it. Regarding c, since you cannot > write into the preference system from external applications (not in a > reasonably easy way, at least), it is also not a valid option. > So you're basically left with a, which means that you have to load the > file into a tab, frame or iframe and run the script on it. Values > stored via GM_setValue are unique to the script, no to the loaded > page, thus they can be used as a kind of poor man's cross domain > information sharing mechanism. I'm not sure, but with the advent of > HTML 5 there may be better ways to do that, though probably not with a > file:/// url. > > -- > You received this message because you are subscribed to the Google Groups > "greasemonkey-users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<greasemonkey-users%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/greasemonkey-users?hl=en. > > -- - Jyothi M.Tech,CSE IITMadras -- You received this message because you are subscribed to the Google Groups "greasemonkey-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en.
