GithubHelp home page GithubHelp logo

Comments (7)

tysonmatanich avatar tysonmatanich commented on July 18, 2024 1

Sorry, can't fix as it is the security model that some browsers chose. However, there is a workaround documented; please see "Expanded Support" section of the related Smashing Magazine article.

from elementquery.

lolmaus avatar lolmaus commented on July 18, 2024

I've managed to locate the problem.

The error happens due to this issue: Firefox not able to enumerate document.styleSheets[].cssRules[] for cross-domain stylesheets.

When i comment out a Google Fonts stylesheet, elementQuery starts working in Firefox.

<link type="text/css" rel="stylesheet" media="screen" href="//fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic&amp;subset=latin,cyrillic-ext,latin-ext,cyrillic">

Please fix this.

from elementquery.

lolmaus avatar lolmaus commented on July 18, 2024

Ain't it possible to make ElementQuery ignore external stylesheets? Make it optional maybe? Tell ElementQuery explicitly which stylesheets to parse?

The issue with Firefox is pretty huge.

from elementquery.

hellolindsay avatar hellolindsay commented on July 18, 2024

I have found a fix for this -- you can modify the elementQuery.js source code and add a line of code. External stylesheets still wont load, but they will fail elegantly without the error or it's side effects:
http://www.smashingmagazine.com/2013/06/25/media-queries-are-not-the-answer-element-query-polyfill/#comment-1221353

from elementquery.

lolmaus avatar lolmaus commented on July 18, 2024

Thank you @hellolindsay.

PS Is there a maintained fork of this lib?

from elementquery.

jesseyangjincheng avatar jesseyangjincheng commented on July 18, 2024

非常感谢!

from elementquery.

lolmaus avatar lolmaus commented on July 18, 2024

非常感谢!

Всегда пожалуйста!

from elementquery.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.