Category : browser-extension

I have this code to get the user selection in my content script: browser.runtime.onMessage.addListener( (message) => { console.log(message); const selectedText = window.getSelection().toString(); console.log(selectedText); }); How I can replace in a simple way the selected text with the message received from the background scipt? Source: Ask Javascript..

Read more

I’m writing a simple browser extension. I have a problem with context menu. I want that the menu I want to add is accessible only on textarea or text input and after the user select some text inside these two type of elements. I’m using this code but I always get this error Unchecked runtime.lastError: ..

Read more

I love the firefox extension multi-account containers. I want to switch to brave browser but I can’t find a good alternative. Is it a functionality that can only work in firefox due to API limitations or is it possible to implement it in chromium based browsers via an extension? If I want to create this ..

Read more

Playing around with add-ons for the first time today. When I load the webpage I’m targeting nothing happens, in contrast to when I first load the add on or if I manually reload it. Video showing the issue here (the "View Streetview" button is what I am injecting with the add-on): https://youtu.be/WjnylmUA9v8, the manifest and ..

Read more