why location.href="javascript:. doesn't work for extensions?

Discussion of bugs in Mozilla Firefox
Post Reply
lastornot
Posts: 9
Joined: September 25th, 2015, 6:07 pm

why location.href="javascript:. doesn't work for extensions?

Post by lastornot »

I need to call web-site's js function (site owns this function) from Firefox Web Extensions

For Chrome web-browser extensions I can use the next line:

Code: Select all

location.href="javascript:SomeFunction(); void 0";
Works great.

But it doesn't work for Firefox

Also in old addons for FF I could call the web-site's js function like this:

Code: Select all

var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
                  .getService(Components.interfaces.nsIWindowMediator);
var mainWindow = wm.getMostRecentWindow("navigator:browser");
mainWindow.gBrowser.loadURI("javascript:SomeFunction(); void 0");
But now I need this in Firefox Web Extensions (like Chrome extensions)

Any ideas?
Post Reply