Hey. I try make script cooperating with Greasemonkey and without GR,
sth like this:

// outsideGR
function main(){
var a = 5;
}

var script = document.createElement('script');
script.setAttribute("type", "text/javascript");
script.appendChild(document.createTextNode('('+ main +')();'));
(document.body || document.head ||
document.documentElement).appendChild(script);

//using GR
alert(unsafeWindow.a);


This alert didint work, a isnt global variable. I use function main()
because I have a big piece of code and dont know how put it on script.
I use this order script.textContent or
script.appendChild(document.createTextNode(), so that is reason why I
use function.

Of course its possible write script.textContent = "var a = 5;", and
everything is ok., but on this way I cant put 5k lines of code (or
maybe ther is a way?).


Another question is associated with localStorage. Stored data are only
available for actual domain, example:

www.mydomain.com

But how share data for www1.mydomain.com, www2.mydomain.com etc. In
the past Firefox 2 have a object GlobalStorage (can use domaing high
lvl), but now it works like a localStorage. I trying to find a way of
cooperation betwen tabs, where domain are diffrent. At the moment I
use GM API, but sandbox slows down the browser (Canvas operation).
Without Greasemonkey (Content Scope Runner - 
http://wiki.greasespot.net/Content_Scope_Runner)
all works very fast, but I do not have access to GM_sevValue,
GM_getValue enabling across domain data exchange. Eny solutions?

-- 
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.

Reply via email to