Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
1 answer
31 views

div movement being choppy on firefox extension

I'm building a firefox extension that outputs a movable div that is controlled by the keyboard but when I try moving down or left (your left when looking at your screen) it doesn't move until I try ...
Emac342007's user avatar
1 vote
0 answers
287 views

Manifest V3 in FireFox not generating any console logs

I have a web extension (Userale) that I am migrating to MV3. I have looked over the Migration guide from FireFox and have followed all of the instructions. I am finally able to load the extension onto ...
aghaemi's user avatar
  • 11
0 votes
0 answers
109 views

window.frames not returning frames in a correct order after iframe is added dynamically

I got an issue with the order of the frames returned by window.frames. Example:- <div1></iframe1></div1> <div2></iframe2></div2> <div3></div3> <div4&...
Vinod Kumar's user avatar
1 vote
1 answer
294 views

Switching between html files inside Firefox extension popup?

I've been trying to port my Chrome extension over to Firefox. Most of the code worked fine, except for this one thing. The extension popup has tab buttons at the top which are supposed to switch ...
dylankjv's user avatar
1 vote
0 answers
2k views

Importing `day.js` doesn't work in my extension despite being usable in the console

I'm trying to use the day.js library in my extension. Data is passed using browser.runtime.sendMessage() from my content script to my background script, which is where I use day.js. Oddly enough, ...
Paul's user avatar
  • 11
1 vote
0 answers
108 views

Chrome/firefox extension javascript not working

I'm trying to make an extension for google meet, and wanted to do tabs as a menu for selecting different functions. When I load index.html in browser everything seems to work fine, but once imported ...
Gurbiel's user avatar
  • 11
-2 votes
1 answer
107 views

How to display things on toolbar icon (Firefox)

I want to display text of the current video playback speed (playbackRate) on top of my toolbar icon. Preferably, on any click anywhere on the page, I want the extension to get the current playback ...
James Grey's user avatar
1 vote
0 answers
79 views

How can I redirect to a new tab with some href URL and with a search cookie/parameter which can give some value like ID or account number?

**Example :**Building an extension which redirect to new tab when click on button or link with URL and with some search cookies or parameter which can give value at URL bar like id or account no. ...
Developer's user avatar
-1 votes
1 answer
184 views

How can i Redirect Chrome/Firefox Extension with same opened tab if we click on same URL again?

I'm trying to create Firefox extension to redirect to new tab when clicked on any URL or button and also to Redirect with same opened tab if we click on same URL again Example: If i click on Link tag, ...
Developer's user avatar
0 votes
0 answers
15 views

Firefox Javascript code Works in console but not through the extension [duplicate]

I have a simple playback speed setter for any HTML tagged videos (YouTube). I get this error when I click on the 2.25 button to try to set the video playback speed to 2.25: "Cannot set properties ...
James Grey's user avatar
2 votes
1 answer
2k views

Chrome Extension :: Trying to understand syntax of chrome.runtime.sendmessage to chrome.runtime.onMessage

I'm having some issues understanding the syntax of how chrome.runtime.sendmessage sends data from my Content.js file to my chrome.runtime.onMessage Background.js file. I'm trying to inject a script to ...
cs2139's user avatar
  • 33
-1 votes
1 answer
81 views

How to select all elements with a specific name under every li node with the same structure?

I have a certain bunch of XPath locators that hold the elements I want to extract, and they have a similar structure: /div/ul/li[1]/div/div[2]/a /div/ul/li[2]/div/div[2]/a /div/ul/li[3]/div/div[2]/a .....
alvn Lin's user avatar
0 votes
0 answers
262 views

How to save where in the DOM of a webpage the html element is

I am making a highlighting browser plugin for firefox as a project. I am trying to find a way to save wherein a webpage a user highlights so I can reproduce it on reload. I do my highlighting by ...
user3038404's user avatar
0 votes
1 answer
127 views

Browser Plugin Tabs - how to show one and hide the other?

I have a prototype browser plugin which opens a popup window, I want to display the main page but have the option to switch to another tab to alter preferences. Currently I can only get it to display ...
reluctantluddite's user avatar
2 votes
0 answers
398 views

How to use Firefox's devtools to inspect web extension content in sidebar?

When web extensions create sidebar content, how does one use Firefox's devtools to inspect that sidebar content while it is presented in the sidebar? If an example is helpful, please consider the Tree ...
Amazon Dies In Darkness's user avatar
0 votes
0 answers
110 views

I'm not able to use express and fetch in web extension

I am trying to build a web extension using some NPM libs such as sqlite3 and express. I generated a bundle script using browserify and required it in a script tag, but when I open the extension, it ...
João Ferreira's user avatar
2 votes
0 answers
41 views

JavaScript function that runs in a closed window

I'm trying to make a chronometer extension in Firefox. I have a function to count minutes and seconds, and it run backwards. The problem is: I call the function with a window.setInterval() method. So ...
leo_val's user avatar
  • 150
2 votes
0 answers
2k views

inject floating button through chrome extension

I am trying to inject a floating button (found from a tutorial) into a webpage through the means of a chrome extension. The code runs with no errors but the button is not shown. Backgorund script to ...
Stefano Pozzi's user avatar
1 vote
1 answer
54 views

Working on a Browser Extension, and so I moved my JS from HTML to the JS file. Now, my localStorage.setItem isn't working

I had an issue where when I would try to test my extension in Firefox using web-ext run, the CSS of the page would load, but none of my HTML would. I found out that this was because my HTML is loaded ...
Mance Rah's user avatar
  • 143
0 votes
0 answers
68 views

Cannot enter slash ('/') in contenteditable for webextension

Consider the following HTML document (panel.html): <!DOCTYPE html> <html> <head> <meta charset="utf-8"/> </head> <body> <div contenteditable="true">...
Scindix's user avatar
  • 1,284
2 votes
1 answer
130 views

Modify outerHTML of video element without destroying video

I'm working on a Firefox extension that deals with adding overlay to video elements. I'm using https://www.w3schools.com/html/mov_bbb.mp4 as an isolated example to test on. However, if I say something ...
Kael Kirk's user avatar
  • 352
0 votes
0 answers
514 views

Chrome Extension to inject a sidebar into page on the right

I'd like to create a chrome extension that injects a sidebar into all webpages. This sidebar would be injected on the right hand side and would have a width of 10vw. I'd like the rest of the page to ...
Somya Agrawal's user avatar
0 votes
2 answers
392 views

Make HTML element inherit transform of another

I am building a browser extension that draws content on top of images in third party websites. For simplicity, assume that it draws a red box of size (img.width/2, img.height/2) over the center of the ...
fizzybear's user avatar
  • 1,217
-1 votes
3 answers
1k views

Firefox WebExtensions inject script in iframe

I am new to javascript and writing web extensions. I want to write a web extension which changes the color of schedule entrys in my university planner. After some starting struggle I've been finally ...
rainbowschedule's user avatar
7 votes
1 answer
37k views

How to make allow-scripts and allow-same-origin coexist in iframe?

So i just want to sandbox one html file in iframe and it works as long as there is just allow-scripts attribute, but as soon as I add allow-same-origin it stops to work because of this: Notes about ...
Marko Žlender's user avatar
0 votes
1 answer
416 views

Webextension - Insert HTML file content in web page content

I'm starting to port a script to a Firefox WebExtension. I'd like to insert into the currently displayed web page some HTML content, that I would like to store into a separate "local" .html file (so I ...
Oliver's user avatar
  • 23.5k
2 votes
2 answers
330 views

Using webNavigation.onCommitted to inject script into web page

I want to find a way to inject a script element, as soon as DOM is usable into the web page and before any other script is loaded, within my web extension. I've attempted achieving this by using ...
chuck-'s user avatar
  • 55
2 votes
0 answers
90 views

I got a ReferenceError: “browser is not defined” in the console when I try create Bookmark in firefox

I am trying create a bookmarks (on this case in firefox) API/bookmarks/create my code is : <!doctype html> <HTML lang="de"> <HEAD> <meta charset="iso-8859-1"> ...
Bastian Blanc's user avatar
-1 votes
3 answers
2k views

How detect a specific url in browser and get html page associate in Javascript?

I need to modifiy a html page with javascript (fill a field). I have a specific url but i do not know how to listen when the browser is on the right url and get the html code associate. I do it with ...
Tinou3231's user avatar
1 vote
2 answers
973 views

Listen to scripts added to document

Is there a DOM event that fires everytime a script is added/loaded? I'm building a extension that must wait until a certain global window object is available and I need to wait for it to exists.
Mojimi's user avatar
  • 3,101
1 vote
1 answer
406 views

using fontawesome in Firefox Webextension Contentscript

I would like to style my Webextension with Fontawesome icons. For the Popup menu and the extension settings, this works without a problem, but my contentscripts can't access it. To create a minimal ...
lhk's user avatar
  • 29.8k
1 vote
0 answers
411 views

WebExtension: set width for options UI

I'm adding an HTML page with options to my webextension. On Firefox it looks something like this: On Chrome, I get this layout: As you can see, in Chrome the HTML is embedded in a kind of popup. The ...
lhk's user avatar
  • 29.8k
1 vote
0 answers
203 views

chrome.tabs.captureVisibleTab vs chrome.desktopCapture

I'm new to Chrome extension development and I am trying to build an extension which take's screenshot of the pages of an ebook. So I was reading the chrome extension documentation and came across ...
Ceroy's user avatar
  • 191
0 votes
0 answers
37 views

Newbie in Firefox Web extensions - asking for some directions

I would like to program a web extension for Firefox and I am aiming to make a bookmark visualization/organizer as close as possible to the old firefox addon Viewmarks: https://dottech.org/165778/how-...
Ibizanhound's user avatar
0 votes
1 answer
161 views

generating HTML in WebExtension results in `this.mDialog is null` and `can't access dead object`

Using a WebExtension, I am trying to programmatically generate an HTML file like this: <html><head><meta><title>example</title></head><body><p>Hello, ...
Nathaniel M. Beaver's user avatar
0 votes
0 answers
571 views

Firefox WebExtension "browser is not defined" for Local Storage

I have been trying to add local storage to a Firefox WebExtension I wrote. As a guide, I pulled the popular "Favourite Colour" example from the webextensions-examples repository on GitHub. However, ...
MBuckman's user avatar
0 votes
0 answers
176 views

Firefox Webextensions: Modify HTML before Browser parsing

I'm writing a Firefox extension. When a new page is loaded, I need to modify the main HTML AFTER it has been downloaded, but BEFORE it's parsed by the browser. If it's not clear what I'm saying, look ...
Nogatco's user avatar
  • 13
2 votes
1 answer
3k views

Web Extension - document.getElementById returning null before execution of async method

I have a chrome/firefox web extension. When clicked, this web extension appends a DIV, which contains several other DIVs and a iFrame in a nested structure, to the inside of the <body> element ...
Foobar's user avatar
  • 8,401
1 vote
0 answers
1k views

Web Extension - Inject Floating Content into Web Page with Content Script

I am writing a firefox/chrome web extension. When the extension's button is clicked it should inject content into a webpage like this: Here, the Bloomberg News Extension injects something (I can't ...
Foobar's user avatar
  • 8,401
2 votes
1 answer
1k views

Is there a maximum width for Firefox/Chrome Extensions?

I am developing a chrome/firefox extension. The extension seems to work fine in certain contexts (it fully displays all content): However, it fails to work in other situations. Take a look at this ...
Foobar's user avatar
  • 8,401
1 vote
0 answers
151 views

How to set value of textarea in different HTML file?

I am building a chrome/firefox web extension. When the user clicks the button in the extension's popup, the extension's UI changes. Here's a visual example: Before pressing one of three buttons: ...
Foobar's user avatar
  • 8,401
2 votes
1 answer
875 views

Get pixels' colors from HTML Canvas WITHOUT getImageData()?

Task I am currently trying to create a web extension for Firefox. It should be able to read images' pixels. For that purpose, I am rendering the image on an invsible canvas, and then I want to read ...
Luatic's user avatar
  • 11.1k
1 vote
1 answer
956 views

Close window with JavaScript background script? (Firefox Extension)

I am currently writing a Firefox extension that opens a new window in my background script. When a user clicks a button on a page the background script executes and opens the window. So far I have: /...
user avatar
0 votes
0 answers
533 views

Chrome Extension: script injected into iframe can't access its content

I've got a Chrome Extension that loads an iframe with some buttons whose functionality I want to control with a script, which I inject into that iframe. However, I can't access elements using document....
Joko's user avatar
  • 176
1 vote
2 answers
102 views

Fully Iterate/Scrape a HTML document in Javascript

I am fairly new to Web-Development, including HTML/CSS and also Javascript. Is there a way to scrape a whole HTML Document, looking for certain patterns in it's inner text, using only vanilla JS? I ...
DoeJ123's user avatar
  • 11
2 votes
0 answers
127 views

The hover action for a browser action popup for a webextensions add-on stays partially highlighted after hover release

I'm working on a webextension and I have a new problem ever since I upgraded to firefox quantum: The popup menu for my extension messes up the hover by staying partially highlighted. . As you can see ...
AndersonHappens's user avatar
1 vote
1 answer
519 views

jQuery: process HTML in chunks

I've got a WebExtension that processes a site's HTML body, sending it to a backend which modifies some of the text, then replacing the old HTML with the backend's response. The problem is that this ...
Joko's user avatar
  • 176
0 votes
1 answer
45 views

How to check if an HTML element has no user facing data (e.g. text or pictures) in javascript?

I have a web application that removes certain elements from a webpage, so after it is done with the initial pass, I want to remove all divs that used to contain data that no longer do. So for example, ...
AndersonHappens's user avatar
0 votes
1 answer
216 views

How to restore the state of checkboxes using WebExtensions storage API

I'm building a firefox web extension and I'd like to give its users some options that they can check/uncheck. The state of the checkboxes is saved locally via the WebExtensions storage API, but I'm ...
Olivier's user avatar
  • 657
1 vote
1 answer
101 views

Web extension - alternative to notification with button

I have a web extension that lets any website access the clipboard. On request I will ask the user if it is okay to give access to the clipboard. I do this in two ways I create a notification The ...
Michael's user avatar
  • 509