Bugsnag-js: Permission denied to access property "apply"

Created on 21 Jan 2019  路  15Comments  路  Source: bugsnag/bugsnag-js

Hey,

I am getting the following unhandled error reported on Bugsnag-js. What could be causing it?

We are using:
"@bugsnag/js": "^5.0.2",
"angular": "~1.7.2",

Error
/
Permission denied to access property "apply"
Jan 21st, 2019, 06:37:30 UTC

STACKTRACE

Error Permission denied to access property "apply"
../../../../../node_modules/@bugsnag/browser/plugin-inline-script-content/inline-script-content.js:37:26 init/e.onreadystatechange

Most helpful comment

@bengourley It happens in the browser on one of our back-office projects. It turned out that DuckDuckGo extension causes this even if a site is in its whitelist. Only disabling this extension helped.

All 15 comments

Bugsnag checks to see if there is something already assigned to document.onreadystatechange and if it is a function it will try to call it.

You'd get this error if something in your codebase, or some third party script, is assigning a function from another domain or from an iframe that this window does not have access to because of the browser's ownership model. It could also be some script injected by a browser plugin or a compromised browser.

Do you know of anything else you include in your application that sets this document.onreadystatechange, or do you do anything weird with iframes or cross origin content?

We aren't doing anything with it specifically, but we have quite a few node_modules that seem to do something with it. These include: @babel/polyfill, angular-ng-truncate, clockpicker, bootstrap-datepicker etc... I found these out by doing a global search on the project. Is there any workaround?

Or can I atleast have the app not crash somehow? This error only occurs very rarely, and I haven't been able to reproduce it.

Could it actually be adblock?

Apparently it's not Adblock Plus or AdBlock for Firefox. This is only happening on Firefox browser version 64.0.0.

Apparently it's not Adblock Plus or AdBlock for Firefox. This is only happening on Firefox browser version 64.0.0.

I can confirm - experience this in FF Developer Edition v66

I can confirm - experience this in FF Developer Edition v66

Can you reliably reproduce this in your own browser or are you talking about events in your dashboard? Does the browser have any extensions running? Is there a publicly accessible page which you see this occur on?

Answers to any of the above should help us figure this out and work out how best to fix it. Thanks!

@bengourley It happens in the browser on one of our back-office projects. It turned out that DuckDuckGo extension causes this even if a site is in its whitelist. Only disabling this extension helped.

I installed DuckDuckGo and was also able replicate it on firefox 64. It doesn't seem to crash the app itself, it only throws the error into the console. I was worried that it might crash the entire app.

It looks like this should have been fixed in DDG's plugin back in August last year, according to the first release that included this PR. What version of the extension did you get?

Looks like the latest version you can get from the Mozilla add-ons website is 2018-6-28, which predates that fix.

https://addons.mozilla.org/en-US/firefox/addon/duckduckgo-for-firefox/versions/

I'm getting this error, on Firefox 69.0.0 and 70.0.0:

node_modules/@bugsnag/browser/dist/bugsnag.js:2275 init/t.onreadystatechange

if (typeof prev === 'function') prev.apply(this, arguments);

@timscott - can you confirm you're using at least version 6.4.1 which includes a fix for #608?

@tomlongridge - From Gemfile.lock:

bugsnag (6.11.1)

@tomlongridge - Ignore my last comment. That's the server side ruby gem. I'm on 6.4.0. I will upgrade.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mdonjones picture mdonjones  路  5Comments

H2go picture H2go  路  5Comments

chobo2 picture chobo2  路  6Comments

vikrantnegi picture vikrantnegi  路  5Comments

v3solutions picture v3solutions  路  6Comments