Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caret-Extension crashes in older browsers #384

Closed
JordanGaede opened this issue Aug 18, 2015 · 7 comments
Closed

Caret-Extension crashes in older browsers #384

JordanGaede opened this issue Aug 18, 2015 · 7 comments
Labels

Comments

@JordanGaede
Copy link

The following line - >computed = window.getComputedStyle ? getComputedStyle( element ) : element.currentStyle; crashes older browses.

window.getComputedStyle looks to require both parameters for older browsers

i.e var style = window.getComputedStyle(elem1, null)

https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle

@Mottie
Copy link
Owner

Mottie commented Aug 18, 2015

Hi @JordanGaede!

What browser is having trouble?

That MDN page shows this syntax:

var style = window.getComputedStyle(element[, pseudoElt]);

but then has a note:

Note: Prior to Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1), the pseudoElt parameter was required. No other major browser required this parameter be specified if null. Gecko has been changed to match the behavior of other browsers.

Leading me to understand that the null was only required in older Firefox browsers.

@JordanGaede
Copy link
Author

Currently its on a test of Firefox v3.0

@Mottie
Copy link
Owner

Mottie commented Aug 18, 2015

Do people still use Firefox v3.0?

And oops, you're right! I did find that IE8 and older need the script to use element.currentStyle. I'll work on a fix for that.


Derp, that's already in there... ok, I can add a null.

@Mottie Mottie added the Bug label Aug 18, 2015
@Mottie
Copy link
Owner

Mottie commented Aug 18, 2015

Actually... on Wikipedia, it shows Firefox v3.0 usage at 0.08%... I bet that is all just from testing.

@JordanGaede
Copy link
Author

Have a few people using Firefox 3.0, 3.2, 3.6.

Thanks for that

@Mottie Mottie closed this as completed in 636e92e Aug 18, 2015
@Mottie
Copy link
Owner

Mottie commented Aug 18, 2015

Ok, it's fixed in the master branch... I'll look to see what else is pending, I might bump the version for you.

@Mottie
Copy link
Owner

Mottie commented Aug 18, 2015

Ok, v1.25.2 is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants