Thank you so much!
That worked perfectly, I cannot believe I did not come across this in
all my searching for a solution.
I suppose I did learn a fair bit about browsers & greasemonkeys
methods of security.
And cheers for the tips using GM_get & GM_set.
For anyone else that stumbles across this thread, heres how I made the
script run on the different frames:
@include both urls
if(document.location.href.indexOf("URL1"))
{
GM_setValue("createdInUrl1", true);
//Code for url 1
}
else if(document.location.href.indexOf("URL2") != -1 &&
GM_getValue("createdInUrl1"))
{
GM_setValue("createdInUrl1", false);
//Code for url 2, i.e. the iframe.
}
Because the browser will block communication between different
domains, parent.etc will not work nor will window.top.etc. So as
suggested above I used GM get/set value.
Setting it to false in the iframe branch ensures it is not set if the
user visits just the iframe url on its own.
On Jul 28, 1:21 am, AClone Iam <
aclone....@gmail.com> wrote:
> 1) Include the domain of the iframe in the scripts includes
> 2) the script will now run once for the normal window and again for the
> iframe content. You will need to detect which domain the script is running
> in, and action accordingly.
>
> You can exchange data between the two running instances of your script, by
> either using
> a) GM_set and GM_get, or
> b) messaging.
>
> Das Shrubber
>
> >
greasemonkey-us...@googlegroups.com<
greasemonkey-users%2Bunsu...@googlegroups.com>
> > .