paulirish / matchMedia.js

matchMedia polyfill for testing media queries in JS
MIT License
2.37k stars 291 forks source link

Error being thrown in Firefox 3.6 #48

Closed luksak closed 11 years ago

luksak commented 11 years ago

I am getting this error in Firefox 3.6:

uncaught exception: [Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: matchmedia.js?v=0.1 :: anonymous :: line 51" data: no]

What is going wrong here?

knightdr commented 11 years ago

@luksak

This may be popping up because of the following: window.getComputedStyle(style)

We should try changing to: window.getComputedStyle(style, null)

The second parameter is for pseudo selectors.

What do you think @paulirish or @scottjehl?

scottjehl commented 11 years ago

If it works, sounds great.

On Oct 4, 2013, at 11:05 AM, David Knight notifications@github.com wrote:

@luksak

This may be popping up because of the following: window.getComputedStyle(style)

We should try changing to: window.getComputedStyle(style, null)

The second parameter is for pseudo selectors.

What do you think @paulirish or @scottjehl?

— Reply to this email directly or view it on GitHub.

luksak commented 11 years ago

I realized that I was using a older version of matchmedia because I am using the Drupal picture module:

https://drupal.org/project/picture

I switched to the most recent version of matchmedia and I kept getting the same error. Using the by @knightdr suggested fix the issue was resolved.

I created a pull request for this: https://github.com/paulirish/matchMedia.js/pull/49

953faa1

knightdr commented 11 years ago

Thanks reporting the issue and creating the pull request @luksak. I just merged your pull request so we can close out this issue.

luksak commented 11 years ago

@knightdr thank you for you effort! Great to get things fixed so fast :)