Dev: Revert to use try catch #67
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {each, has} from '../lib/util';
|
||||
import {each} from '../lib/util';
|
||||
|
||||
function formatStyle(style)
|
||||
{
|
||||
@@ -46,8 +46,14 @@ export default class CssStore
|
||||
|
||||
each(document.styleSheets, (styleSheet) =>
|
||||
{
|
||||
// Started with version 64, Chrome does not allow cross origin script to access this property.
|
||||
if (!has(styleSheet, 'cssRules')) return;
|
||||
try
|
||||
{
|
||||
// Started with version 64, Chrome does not allow cross origin script to access this property.
|
||||
if (!styleSheet.cssRules) return;
|
||||
} catch (e)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
each(styleSheet.cssRules, (cssRule) =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user