-
Notifications
You must be signed in to change notification settings - Fork 9
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
Check for Element type? #11
Comments
I was able to replicate that error by including the script in the In any case, it sounds like a good idea to add a safeguard around those expressions. Thanks for raising the issue! |
Maybe #12 solves this as well? |
Re-read the problem description – #12 probably does not help: The exceptions occur outside the current try/catch block. Would it make sense to have a much broader exception handling in that method, catching all sorts of errors and reverting the |
Yes, that sounds sensible. I don't have the capacity to look into this right now, so I'll leave it open for when I or someone else has the chance to make it happen. Thanks! |
Hi,
We log JS errors from our users, and very infrequently, this line in
include-media.js
causes some errors:if (window.getComputedStyle && (window.getComputedStyle(element, '::after').content !== ''))
For instance, Googlebot encountered
Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
todayAnd 48 Firefox users (versions 47-50) encountered
TypeError: window.getComputedStyle(...) is null
over the past couple monthsI can't pin down why this sometimes happens and have never been able to reproduce it myself, but I think it would help clear out some edge cases to check that window.getComputedStyle is a function and element is an Element before trying to use them?
Thanks!
The text was updated successfully, but these errors were encountered: