Hi,
I maintain an add-on for Chrome and Firefox. It uses the Add-on SDK for Firefox, and now I want to try to make it work with the new WebExtensions API.
From a content script my add-on does this:
var popupWin = open("", “”, “width=850,height=800,scrollbars=yes”);
var document = popupWin.document;
This works fine in Chrome, but in Firefox with WebExtensions, the last line fails with this error:
Error: Permission denied to access property “document”
In my Add-on SDK version I was able to work around this error by using this instead:
var popupWin = new XPCNativeWrapper(unsafeWindow.open("", “”, “width=850,height=800,scrollbars=yes”));
var document = popupWin.document;
But it seems that those variables needed for this workaround are no longer available in the WebExtensions API.
Any tips on how I can make this work with the WebExtensions API?
(P.S. the reason I need to open a blank window and access it is to work around https://bugzilla.mozilla.org/show_bug.cgi?id=792479 in the Add-on SDK. This workaround may not be needed anymore with WebExtensions, but if it is not needed, it would require a larger refactoring of my add-on to remove, so I would prefer to get it to work with WebExtensions before refactoring it to not work with the Add-on SDK.)