I am writing a chrome extension and I want to executeScript in the extension page such as chrome-extension://URL. When I try to run the script in the extension page with:
chrome.tabs.executeScript( { code: `myFunc(${myVariable})` } );
in the extension page, I am getting the following error:
Unchecked runtime.lastError: Cannot access contents of url "chrome-extension://mcbaafjcjmpmjjbdpadcpenjmnkaneel/test.html". Extension manifest must request permission to access this host.
It looks like I cannot request permission for chrome-extension pages. Is there any workaround for this issue?
Note: I have tried to run the same command from the background.js file but I am getting the same error.
Thanks