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

src/bugsnag: fix Opera Mobile test failures #70

Merged
merged 1 commit into from
Aug 23, 2014

Conversation

kyrylo
Copy link

@kyrylo kyrylo commented Aug 23, 2014

Fixes #67 (Some tests fail on Opera Mobile)

The old approach was giving failures on Opera Mobile (and probably
some other minor browsers). The problem is that
document.currentScript is unsupported by Opera Mobile, so it was
always undefined (hence, lastScript, too).

We use document.scripts instead. It is supported by all browsers:
https://developer.mozilla.org/en-US/docs/Web/API/document.scripts

@jmshal
Copy link

jmshal commented Aug 23, 2014

This looks good, but for legacy support, I'd recommend doing something like this...

var scripts = document.scripts || document.getElementsByTagName("script");

document.scripts returns undefined on < FF9, and falls back to document.getElementsByTagName("script").

I have a large client still on FF3.0, so I'd love to continue to support them :)

The old approach was giving failures on Opera Mobile (and probably
some other minor browsers). The problem is that
`document.currentScript` is unsupported by Opera Mobile, so it was
always undefined (hence, `lastScript`, too).

We use `document.scripts` instead. It is supported by all browsers:
https://developer.mozilla.org/en-US/docs/Web/API/document.scripts
@kyrylo
Copy link
Author

kyrylo commented Aug 23, 2014

Thank you. Fixed :)

ConradIrwin added a commit that referenced this pull request Aug 23, 2014
src/bugsnag: fix Opera Mobile test failures
@ConradIrwin ConradIrwin merged commit 8c144d3 into master Aug 23, 2014
@ConradIrwin ConradIrwin deleted the opera-mobile-tests-fix branch August 25, 2014 18:51
kattrali pushed a commit that referenced this pull request Apr 22, 2021
Allow Act to run the tests with Ubuntu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants