question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught SecurityError: Blocked a frame with origin X from accessing a frame with origin Y

See original GitHub issue

I 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 contacts_1
  • From contacts click on any email to open compose screen in a frame contacts_2
  • Error is in console and script is not loaded contacts_3 contacts_4

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:closed
  • Created 7 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
davojtacommented, Jun 30, 2018

I will try in next days!

1reaction
josteinkcommented, Jun 28, 2018

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found