How to pass an iframe input value in a chrome extension manifest 3

Viewed 119

I'm building a chrome extension manifest 3 which inject an Iframe (toolbar) on a page via a contentscript.js file, which is called on pages via a background.js script.

So far so good the toolbar appears on the page... but I want to pass an input value from the toolbar to a xmlrequest.js file that is injected via the contentscript.js, and I got this error:

Uncaught DOMException: Blocked a frame with origin "domain" from accessing a cross-origin frame.

I read countless questions/answers about this but I can't figure out where to start.

The manifest content all the resources for the toolbar:

"resources": ["mark.js","toolbar.html","xmlrequest.js","add-toolbar.js","toolbar.css"], 

add-toolbar.js content iframe.src = 'chrome-extension://xxxxxxx/toolbar.html';

Thanks for your help.

0 Answers
Related