filamentgroup / grunt-criticalcss

Grunt wrapper for criticalcss
MIT License
530 stars 26 forks source link

Warning about unsafe access from file URLs #32

Closed rupl closed 1 year ago

rupl commented 9 years ago

I've noticed this before in my own generated CSS and noticed it again while peeking at https://filamentgroup.com to show an example of using this module:

Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL file:///Users/scott/Sites/fgwebsite/node_modules/grunt-criticalcss/node_modules/criticalcss/lib/criticalrunner.js. Domains,protocols and ports must match.

I'm pretty sure this warning comes from PhantomJS: https://github.com/ariya/phantomjs/issues/12697

rupl commented 9 years ago

Whoops I forgot to mention the important part: this warning is ending up as part of the inlined CSS.

scottjehl commented 9 years ago

I too have seen this. Verified.

On Sep 16, 2015, at 6:22 AM, Chris Ruppel notifications@github.com wrote:

Whoops I forgot to mention the important part: this warning is ending up as part of the inlined CSS.

— Reply to this email directly or view it on GitHub https://github.com/filamentgroup/grunt-criticalcss/issues/32#issuecomment-140711830.

zachleat commented 8 years ago

@jefflembeck has pointed out to me that there is an ignoreConsole option: https://github.com/filamentgroup/criticalCSS#optionsignoreconsole

I think setting that to true will solve this issue.

rupl commented 8 years ago

You think it's worth defaulting this option to true? Seems like a sensible default for the general users since the warning itself is out of the control (and not the responsibility) of this project. I've seen this warning verbatim on other downstream projects from Phantom, e.g. Casper tests.

jefflembeck commented 8 years ago

It definitely is.

It will mean a major release (2.0) but il not too opposed to that.

On Wednesday, November 4, 2015, Chris Ruppel notifications@github.com wrote:

You think it's worth defaulting this option to true? Seems like a sensible default for the general users since the warning itself is out of the control (and not the responsibility) of this project. I've seen this warning verbatim on other downstream projects from Phantom, e.g. Casper tests.

— Reply to this email directly or view it on GitHub https://github.com/filamentgroup/grunt-criticalcss/issues/32#issuecomment-153949616 .