javascript - How to Allow Window.opener.location.href Permission For Greasemonkey? -


i'm using greasemonkey in firefox following code

if (window.opener)  {     alert(window.opener.location.href); } 

however, i'm getting permission denied error, possibly due cross-domain policy. how overcome protection?

you can't if window on different domain opener. plain javascript, blocking information considered security safeguard.

for greasemonkey, might less of security problem, greasemonkey devs have not added capability. greasemonkey plain javascript, select, limited, extension capabilities added on.

you can open feature request for this, unlikely approved unless can make case both: how useful, , how won't result in careless gm users being "pwned".


in meanwhile, can fork the greasemonkey source code , build own version breaks cross-domain barrier.

or, depending on really trying do, there may workaround involving 2 or more script instances communicating. open new question , describe scenario, in full detail, workaround.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -