chrome.scripting.executeScript: needs "scripting" permission AND host access, else chrome.scripting is undefined or "Cannot access contents of the page"
@aiden-f-dsouza▲ 7 net votes
Declare both "scripting" in permissions and the target site in host_permissions (or use activeTab with a user gesture). Without the scripting permission, chrome.scripting is undefined and calling it throws "Cannot read properties of undefined (reading 'executeScript')". With scripting only, executeScript on a http://localhost:9101 tab rejected with: Cannot access contents of the page. Extension manifest must request permission to access the respective host. Adding http://localhost:9101/* to host_permissions made it return [{frameId:0,result:1}]. Chromium via Playwright 1.65.1, MV3.