Gofake1 / Nightlight

Browse the internet more comfortably at night
https://gofake1.net/projects/nightlight.html
MIT License
88 stars 9 forks source link

rdar://42491788 - (Safari) CSSStyleSheet.cssRules is sometimes null #11

Closed Gofake1 closed 5 years ago

Gofake1 commented 6 years ago

Summary: The 'cssRules' property on CSSStyleSheet is null in some cases. It seems to happen when the corresponding style sheet is very large.

Steps to Reproduce:

  1. Log in to bugreport.apple.com

  2. Open the console: Code: [].slice.call(document.styleSheets).filter(s => !s.cssRules) // Get style sheets with null cssRules

  3. Inspect the results.

Expected Results: The array should be empty (i.e. all CSSStyleSheets have non-null cssRules).

Actual Results: For bugreport.apple.com, three stylesheets "failed".

Version/Build: 12.0 (14606.1.24.40.1)

Configuration: macOS 10.14 (18A336e)

Comments: Also reproducible on Safari TP (14606.1.25.1) In comparison, Chrome 67 supports the expected behavior

Gofake1 commented 5 years ago

Unfortunately this appears to be expected behavior relating to CORS. Disabling CORS via the Develop menu results in the expected behavior. Since we can't expect users to disable a security measure in order to use a browser extension, we'll have to find another solution.