'How do you get the source of a website from a chromium extension? [duplicate]

I want to create an application that can read the values in the HTML and output them in the popup. I am confused, how can I get the HTML source of the website that the user is connected to?



Solution 1:[1]

Use a content script to insert a JavaScript file into the page (see here). You can use document.documentElement.innerHTML to access the complete innerHTML of a page. (See also this answer to another question)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1