painty / CSS-Used-ChromeExt

Get all css rules used by the selected DOM and its children.
https://chrome.google.com/webstore/detail/css-used/cdopjfddjlonogibjahpnmjpoangjfff
MIT License
263 stars 62 forks source link

extension stuck in parsing. #9

Closed emmastone9 closed 6 years ago

emmastone9 commented 6 years ago
  1. The url of page inspected.

https://teslanomics.co/

  1. The element inspected.

div id=body-wrap

  1. Expected result.
Parsed CSS
  1. Actual result.
Extension stuck in parsing: 
Parsing : https://teslanomics.co/wp-content/plugins/js_composer/assets/css/js_composer.min.css

Any idea what might be wrong here?

emmastone9 commented 6 years ago

<link rel='stylesheet' id='videopro-parent-css' href='https://teslanomics.co/wp-content/themes/videopro/style.css' type='text/css' media='all' />

I removed the above stylesheet and the extension worked without any issues. @painty is there anything specific to the above CSS that might be causing the extension to go in a loop?

emmastone9 commented 6 years ago

one more update, turns out the following line pair in one of the CSS includes [https://teslanomics.co/wp-content/themes/videopro/style.css] was causing the problem: .slider-toolbar .prev-slide:hover, .slider-toolbar .next-slide:hover { background-color:background-color:rgba(19,19,19,1.0); color:rgba(255,255,255,1.00);} Commenting out these two lines fixed the problem.

Chrome console does show a stack trace, see below:

postcss.js:6503 Uncaught (in promise) TypeError: Cannot read property '0' of undefined
    at SafeParser.decl (postcss.js:6503)
    at SafeParser.decl (postcss.js:2879)
    at SafeParser.precheckMissedSemicolon (postcss.js:2917)
    at SafeParser.decl (postcss.js:6536)
    at SafeParser.decl (postcss.js:2879)
    at SafeParser.other (postcss.js:6435)
    at SafeParser.loop (postcss.js:6381)
    at safeParse (postcss.js:2812)
    at new LazyResult (postcss.js:4806)
    at Processor.process (postcss.js:7391)

I'll try to fix this and submit it as a PR.

emmastone9 commented 6 years ago

@painty i am bit stuck here in terms of debugging. Any pointers on how I can fix this or where I should be looking?

berlinone commented 6 years ago

Same for me...

postcss.js:6503 Uncaught (in promise) TypeError: Cannot read property '0' of undefined at SafeParser.decl (postcss.js:6503) at SafeParser.decl (postcss.js:2879) at SafeParser.precheckMissedSemicolon (postcss.js:2917) at SafeParser.decl (postcss.js:6536) at SafeParser.decl (postcss.js:2879) at SafeParser.other (postcss.js:6435) at SafeParser.loop (postcss.js:6381) at safeParse (postcss.js:2812) at new LazyResult (postcss.js:4806) at Processor.process (postcss.js:7391)

painty commented 6 years ago

Fixed in 2.2.7, goto chrome://extensions/?id=cdopjfddjlonogibjahpnmjpoangjfff and update.

Dependencies Updated (postcss-safe-parser) with more CSS error tolerance.