I want to have a webextension with an iframe http://localhost:8080. So I can test my option page. I want to get access to extension API. So I don't care about security for developing.
So made a page
chrome-extension://abcdefghijklmnopqrstuvw/page/index.html
<html>
<body>
<iframe id="myFrame" src="http://localhost:8080" crossorigin="anonymous">
</iframe>
<script src="script.js"></script>
</body>
</html>
localhost:8080
<html>
<head>
</head>
<body>
<h1>I can't get this working :{</h1>
<script>
console.log(parent);
</script>
</body>
</html>
I also send a header: "Access-Control-Allow-Origin": "*"
Of course I got this error:
DOMException: Blocked a frame with origin "http://localhost:8080" from accessing a cross-origin frame.
I tried to disable web security
google-chrome-stable --disable-site-isolation-trials --disable-web-security --user-data-dir="~/tmp"
But the error is still there. I also tried web-ext to disable web security.