Uncaught SecurityError: Blocked a frame with origin X from accessing a frame with origin Y
See original GitHub issueI writing the plugin to chrome similar to gmail-chrome-extension-boilerplate and get the following error:
gmail.js:10 Uncaught SecurityError: Blocked a frame with origin "https://mail.google.com" from accessing a frame with origin "https://contacts.google.com". Protocols, domains, and ports must match.Gmail_
@ gmail.js:10(anonymous function)
@ gmail.js:10main
after the steps:
- Install chrome extension similar to gmail-chrome-extension-boilerplate
- Navigate to gmail
- Click contacts

- From contacts click on any email to open compose screen in a frame

- Error is in console and script is not loaded

Temporary workaround (at least to load script and do not break main.js) is to surround the block of code with try/catch:
try {
api.tracker.globals = typeof GLOBALS !== 'undefined' ? GLOBALS : ( window.opener != null && typeof window.opener.GLOBALS !== 'undefined' ? window.opener.GLOBALS : [] );
api.tracker.view_data = typeof VIEW_DATA !== 'undefined' ? VIEW_DATA : ( window.opener != null && typeof window.opener.VIEW_DATA !== 'undefined' ? window.opener.VIEW_DATA : [] );
} catch (err) {
console.error(err);
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:8
Top Results From Across the Web
SecurityError: Blocked a frame with origin from accessing a ...
SecurityError : Blocked a frame with origin "http://www.example.com" from accessing a cross-origin frame. How can I access the elements in the ...
Read more >Blocked a frame with origin “domain.com” from accessing
Hi, Your error is expected if your page and Forms are using different domains. For the same-origin policy browsers block scripts trying to...
Read more >Blocked a frame with origin from accessing a cross-origin frame
SecurityError : Blocked a frame with origin from accessing a cross-origin frame. ... For example, when Site X tries to fetch content from...
Read more >Resolving the Blocked a Frame with Origin "null ... - HackerNoon
If you see an error that says “Blocked a frame with origin from accessing a cross-origin frame”, it means that this security feature...
Read more >Uncaught SecurityError: Blocked a frame with origin - jQWidgets
I am running all kinds of JavaScript and accessing images other javascript files and everything inside of an iframe that houses the Layout ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I will try in next days!
OK. I’ll take your word for it.
As an absolute worst case, I cannot see this change negatively impacting or breaking any code which works now, so if you say this change will help a use-case you have, I guess we have nothing to lose by trying 😃
Could you provide your changes as PR?