I'd like to use the popup of an extension to set settings that make changes on about:blank
pages html one is on (from Google Slide Presenter in a separate tab), in terms of how the extension is supposed to behave on that page.
As far I understood I need to use content_scripts due to about:blank
which requires "match_about_blank" : true
as otherwise I have not way to run javascript on that page via the extension, unless there is a way using executeScript
?
Is it possible from within the popup to access the HTML of that open tab using content_script?
I.e. I'd like to retrieve the tabs page title, i.e. using document.title or extract from the HTML. Also with Javascript I'd like to change some of the content within a div.
The only workaround I can think of, unless its the only way, is to run javascript on the page to extract and store the value (chrome.storage.sync.set) so I can retrieve it in the popup with javascript (chrome.storage.sync.get).
Wondering if there is a better way directly and also how to change content in the tab i.e. by clicking a button in the popup (maybe via event listener on the tab and a push from the popup?).
I already tried the answer using chrome.scripting.executeScript
. with Manifest v3 but couldn't make it work. How to access the webpage DOM/HTML from an extension popup or background script?