Category : firefox-webextensions

I’m working to translate a self-made extension. I have a problem with that code : let radiosCapture = { "Capture a page": () => { this.capture = new CaptureLink(this); let description = document.querySelector(‘meta[name="description"]’); if (description) { this.capture.description = description.content; } this.capture.start_capture(); }, "Capture an area": () => { this.capture = new CaptureZone(this); this.capture.start_capture(); } }; ..

Read more

I’m writing a browser extension to intercept all the script tags on the page when it’s loaded, but before they execute. To be clear, I’m not looking to block the scripts entirely; I just want to intercept and analyze/modify them before they’re run. Is there a way to do this? I’m aware of onbeforescriptexecute for ..

Read more

chrome.runtime.onStartup.addListener( function(){ moment.tz.setDefault("America/New_York"); } ) I am developing a privacy and proxy extension that changes the IP of the browser for a certain interval. Here there is a mismatch in browser timezone and IP server timezone. I’m trying to change the browser timezone using the above code but it’s of no use. Please guide to ..

Read more

While fetching a files contents with the following code in a background.js file: function readFile(filename) { let response = fetch(`file:///${filename}`); console.log(response); } I get the following error: Security Error: Content at moz-extension://86d386b7-2904-441f-8dbe-47f0af9b6bfb/_generated_background_page.html may not load or link to file:///C:/Users/rando/Downloads/jest-26.6.1.zip. TypeError: NetworkError when attempting to fetch resource. My manifest file looks like this: "permissions": [ "webNavigation", ..

Read more

I’m trying to send and receive a response in a firefox extenstion. I’m able to send the response successfully using the following code in my content script: function notifyBackground(message) { var sending = browser.runtime.sendMessage({requestType: message}); sending.then(handleResponse, handleError); } document.getElementById(‘downloads-select’).addEventListener(‘click’, function () { notifyBackground("requestDownloads"); }); When this is sent from the content script, in the browser ..

Read more