mirror of
https://github.com/liriliri/eruda.git
synced 2026-03-20 09:38:37 +08:00
Optimize: Use .hasOwnProperty to check cssRules accessibility
This commit is contained in:
@@ -46,14 +46,8 @@ export default class CssStore
|
||||
|
||||
each(document.styleSheets, (styleSheet) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
// Started with version 64, Chrome does not allow cross origin script to access this property.
|
||||
if (!styleSheet.cssRules) return;
|
||||
} catch (e)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Started with version 64, Chrome does not allow cross origin script to access this property.
|
||||
if (!styleSheet.hasOwnProperty('cssRules')) return;
|
||||
|
||||
each(styleSheet.cssRules, (cssRule) =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user