2

I am getting a error in my code that only seems to happen on Chrome version 67+ on Android only. I am not having this problem on any other platform using Chrome. This happens occasionally.

Error Message: SecurityError: Failed to read the 'cssRules' property from 'CSSStyleSheet': Cannot access rules.

In terms of where the error happens, one only solid traces I've seen in breadcrumbs is HTMLLinkElement.cleanupVisited.

I've seen the mentioned error talked about in the context of the new Chrome 64+ CORs changes but my css is served on the same domain and I am not calling .cssRules() api's anywhere in my source code.

Anyone else seeing the same thing?

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
Chris Lam
  • 83
  • 4

1 Answers1

0

I was seeing exactly the same issue. But I discovered that my Asp.Net Mvc project was calling the method .cssRules through the modernizr 2.8.3 library (line 691). I found the reason of this issue on this post https://stackoverflow.com/a/49161468/2095712. The author states:

Since our (naïve) function was iterating through all loaded stylesheets, it was attempting to access this stylesheet injected by the extension and thus causing the CORS error.

Since this CSS is hosted in another domain this problem will be seen on the logs (sentry in my case) when user has such kind of extension installed.

rotaran
  • 59
  • 2
  • 10