You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When elementQuery tries to load an external style sheet, some browsers will throw an error: “SecurityError: The operation is insecure.” -- this comment explains how to fix it.
The error is thrown from line 151 in the unminified source:
if (styleSheet[cssRules] && styleSheet[cssRules].length > 0) {
Using try/catch, we can detect this error and return instead of letting the script fail. The simplest way to do this is to add the following line right above the if-statement (add this line to line 151, pushing the if-statment to line 152)
When elementQuery tries to load an external style sheet, some browsers will throw an error: “SecurityError: The operation is insecure.” -- this comment explains how to fix it.
The error is thrown from line 151 in the unminified source:
if (styleSheet[cssRules] && styleSheet[cssRules].length > 0) {
Using try/catch, we can detect this error and return instead of letting the script fail. The simplest way to do this is to add the following line right above the if-statement (add this line to line 151, pushing the if-statment to line 152)
try { styleSheet[cssRules].length; } catch(err) { return; }
With this in place, the security error and it’s side-effects will disappear.
The text was updated successfully, but these errors were encountered: