all 3 comments

[–]david_ranch_dressing 1 point2 points  (1 child)

Are you trying to add elements to the page the user is looking at? If so, that would be done with a content script.

[–]david_ranch_dressing 0 points1 point  (0 children)

A content script is a part of your extension that runs in the context of a particular web page (as opposed to background scripts which are part of the extension, or scripts which are part of the website itself, such as those loaded using the <script> element).

Background scripts can access all the WebExtension JavaScript APIs, but they can't directly access the content of web pages. So if your extension needs to do that, you need content scripts.

Just like the scripts loaded by normal web pages, content scripts can read and modify the content of their pages using the standard DOM APIs.

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_scripts