skip to Main Content

Javascript – First Firefox extension test not going well

I am writing a first test of a firefox extension. I am using the following websites as assistance: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Context_menu_items https://github.com/mdn/webextensions-examples/blob/main/menu-demo/background.js Here is my code: mainfest.json { "manifest_version":2, "version":"1.0", "name":"Test", "content_scripts":[ { "matches":["<all_urls>"], "js":["main.js"] } ], "permissions":["contextMenus"] } main.js alert("test");…

VIEW QUESTION

Javascript – I'm building addon for firefox user can take screenshot, but browser.runtime.sendMessage returns undefined

I'm trying to implement a function that user can take screenshot using browser.tabs.captureVisibleTab . But browser.runtime.sendMessage immediately returns undefined. In console.log("dataUrl ::: ", dataUrl) of browser.runtime.onMessage.addListener it logged data url, so it's working. But somehow, it's undefined in screenshot.addEventListener My…

VIEW QUESTION
Back To Top
Search