0

I am trying to create a browser extension following this tutorial and I want to create an extension which can access the actual document and ideally all the network (requests etc.).

But when I print out the documentURL from document

print(document.documentURI)

inside index.html I get the URI of the extension itself (like chrome-extension://enlpckinaieecgmjgamlcbicmjiahkkf/index.html) and not for the webpage it is running on.

How to "access" the actual webpage?

Alex
  • 41,580
  • 88
  • 260
  • 469
  • [How to access the webpage DOM/HTML from an extension popup or background script?](https://stackoverflow.com/q/4532236) – wOxxOm Nov 29 '22 at 12:55
  • Thanks, but the page linked in that answer does not explain how to download the script `contentScript.js`... – Alex Nov 29 '22 at 13:05
  • There's no need to download it, the answer describes a complete solution, but I don't know how to apply it to your case of using python. – wOxxOm Nov 29 '22 at 14:14
  • Maybe pyscript is not the best choice for what I want to do actually. – Alex Nov 29 '22 at 14:20

0 Answers0