0

I tried a few ways to execute a script that gets the source (document.body) of the active tab. All of them work when I use the script on a random url, but NONE of them work when I try to use the script on a link of an extension "chrome-extension://..."

Firstly, I use a PDF viewer extension (that was not made by me) that opens the PDF in HTML format. Then I need to process the source with my extension. Therefore, the link that I try to get the source of starts with "chrome-extension://...".

But I do not have permission to execute scripts in "chrome-extension://". The error I get is:

Uncaught (in promise) Error: Cannot access a chrome-extension:// URL of different extension

Is there any kind of workaround? Is there a way to permit such execution?

Is there any way to get the source (document.body) of an active tab that is another chrome-extension?

Yavor Tashev
  • 144
  • 1
  • 1
  • 8
  • 2
    Not possible unless you start chrome with a [special command line switch](/q/19042857). – wOxxOm Apr 12 '22 at 17:13
  • Thank you, wOxxOm! I've seen your answers on stackoverflow and trust your expertise. I will leave the question, if someone finds a workaround in the future. – Yavor Tashev Apr 13 '22 at 07:02

0 Answers0