Manipulate HTML from Firefox Extension

I am creating a Firefox extension that is somewhat similar to Firebug. At the bottom of the browser there is a panel (or vbox) that allows users to specify colors for certain HTML elements. When they click OK, I would like these colors to be updated on the current web page.

My JavaScript works for me when I click the button (I just throw a warning), however, when I change this JavaScript to change the CSS or element styles (using either document.getElementById or jquery) nothing changes.

Is there anything with the Firefox extensions that I am missing? Any help is appreciated.

Let me know if you have any questions. Thanks

+3
source share
1 answer

https://developer.mozilla.org/en/Extension_Frequently_Asked_Questions#Accessing_the_document_of_a_webpage_doesn%27t_work

You want the content .document.getElementById () and similarly for any other construct you use.

+2
source

Source: https://habr.com/ru/post/1733253/


All Articles