I’m trying to port my Chrome extension for Firefox. It opens after clicking on the addon button in the addon bar a new tab with an address http://example.com#url=http://url-of-the-current-page.com.
The code for this is void(window.open('http://example.com#url='+window.location.href,'_blank'));.
This code is triggered by background script looking like chrome.browserAction.onClicked.addListener(function(tab) { chrome.tabs.executeScript(tab.id, {file: "code.js"}) });.
In Chrome this works like a charm. In Firefox it triggers the popup blocker with an alert Firefox prevented this site from opening a popup window.
How could i avoid popup blocker triggering and just immediately open new tab with my url?
thank you for quick reply! maybe i use it wrong, but your code just opens a current url in the new tab… But i need that it executes the code from the file code.js…
Could you please explain how i properly use your code? This is my first approach to FF addons:)