I am converting a working chrome extension to a firefox extension. In the extension, it calls window.open() in the background.js. However, it is not working in my firefox version, and I have tested that everything else is working fine, and it is just not window.open'ing.
I read online that it could be due to a security issue? How do I adjust the security settings so it will be able to run, and how do I notify the user to?
manifest.json
{
"manifest_version": 2,
"name": "Instagram Liker",
"description": "Instagram Liker",
"version": "1",
"icons": {
"16": "icon16.png",
"48": "icon48.png",
"128": "icon128.png"
},
"content_scripts": [
{
"matches": [
"<all_urls>"
],
"js": [
"js/custom.js"
]
}
],
"background": {
"scripts": [
"js/background.js"
]
},
"browser_action": {
"default_popup": "popup.html"
}
}
The window.open is just being called in a function in the background.js, I don't think I need to post that code.
I encounter exactly the same problem, solution is to not use
window.open("yourUrl")
but instead use method provided only for browser extensions
browser.windows.create({url: ""yourUrl""});
With this solution you can be sure your event page won't be blocked by any popup blocker.
It worked for me without the double "":
browser.windows.create({url: yourUrl});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With