javascript - Opening a new tab in multiprocess Firefox? -


i trying port existing firefox addon code new multiprocess architecture. in existing code able launch new tab on addon install event using code below:

function install(data, areason) {     if (areason == addon_install) {         var wm = components.classes["@mozilla.org/appshell/window-mediator;1"]             .getservice(components.interfaces.nsiwindowmediator);         var mainwindow = wm.getmostrecentwindow("navigator:browser");         mainwindow.gbrowser.addtab('http://www.mywebsite.org/install-success-page.html');      }      if (areason == addon_upgrade) {          var wm = components.classes["@mozilla.org/appshell/window-mediator;1"]             .getservice(components.interfaces.nsiwindowmediator);         var mainwindow = wm.getmostrecentwindow("navigator:browser");         mainwindow.gbrowser.addtab('http://www.mywebsite.org/update-success-page.html');     }  } 

after making changes bootstrap.js become multiprocess firefox compatible (using other extension's code) addon loads , functions expected above code fails load new tab , no error gets displayed in console !!!

this should work:

var cu = components.utils; var { require } = cu.import(resource://gre/modules/services.jsm", {}); const tabs = require("sdk/tabs"); tabs.open(url); 

also less break in future platform code.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -