0

I have an issue with the use of window.opener.

Whenever I use window.open("url"), the opened window will reference window.opener fine, but when I use GM_openInTab that claims to be equivalent (and I use it for the cross browser compatibility because opening in tabs is essential) it's window.opener value for the child window is null.

How come GM_openInTab's opened window window.opener is null? How can I get around this?

Edge
  • 2,456
  • 6
  • 32
  • 57
  • Even Greasemonkey cannot allow cross-domain javascript execution. Use messaging to tell the opening script instance what you want to do. – Brock Adams Feb 17 '14 at 21:32
  • It's not crossdomain that I'm doing though – Edge Feb 18 '14 at 00:41
  • Okay, but then it's still cross-sandbox -- which is similar, in practice. The solution is the same. – Brock Adams Feb 18 '14 at 01:22
  • I don't understand why window.open works but GM_openInTab doesn't. I could use window.open and the problem would be fixed, but then it won't open in a new tab like I want. – Edge Feb 18 '14 at 01:42

1 Answers1

0

The problem is I was doing this under the Scriptish addon environment, which while originally forked from Greasemonkey has a recorded (and still unfixed) bug where GM_openInTab returns null.

I have attempted to alert them of the ongoing nature and annoyance of this bug, but nothing has happened yet. It will be up to the Scriptish developers to fix this, and it's a shame it hasn't been fixed as I find Scriptish to suit my needs far better than Greasemonkey due to privacy concerns.

Edge
  • 2,456
  • 6
  • 32
  • 57