In the title, what I mean by default_popup js file is the javascript file linked with the html popup page when the extension icon is clicked. Below, in the manifest.json file, default_popup js file would be linked to the random.html file, which would show up if the icon is clicked.
"browser_action": {
"default_icon": "icon.png",
"default_title": "example extension"
"default_popup": "random.html"
}
For my upcoming project, I am trying to create a google chrome extension that allows the user to click the extension icon to show the default_pop html file, enter some data, and calculate some result based on the elements on the current webpage (or active tab).
My concern is that I don't understand how the default_popup js file can access the contents of the active tab. For example, using document.getElementById() would look through random.html instead of the actual active tab. I was wondering if there was anyway for the the default_popup js file could some how read/extract data from the active tab to then perform some calculations on.