Reputation: 347
I currently have a Google Chrome extension that can read the dom of the page I am viewing, by accessing:
document.documentElement.outerHTML
I can then also get it to print elements of the dom to the console of the current page, extension and background page. (Hurray!)
I have come across a scenario where I need to access the dom of a view-source page. When I try to get the extension to print to the page console, I am unable to do so. It prints nothing (no error message). Yet If I manually type into the console command line in browser, I am able to successfully interact with it. Is there a way to print to the console in this instance? My extensions appears to work for all other standard pages.
It works as follows: I press a button on my extension UI which tells popup.js to run a different script containing console.log("Hello")
.
All help is appreciated!
Just to clarify, I right click on a page and press 'view page source' which opens up a new tab. This is the tab I am trying to print to the console of.
Upvotes: 1
Views: 18