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

v1.1.2 or later can crash apps on Opera Mini extreme data saving mode #185

Closed
jroebu14 opened this issue Oct 6, 2021 · 4 comments · Fixed by #186
Closed

v1.1.2 or later can crash apps on Opera Mini extreme data saving mode #185

jroebu14 opened this issue Oct 6, 2021 · 4 comments · Fixed by #186

Comments

@jroebu14
Copy link
Contributor

jroebu14 commented Oct 6, 2021

Hi,

We first reported a problem with v1.1.2 here #159 which we submitted a fix for.

However when we upgraded to v2.0.1, which contains the fix, we discovered the crash still happened on Opera Mini.

To mitigate this we resorted to wrapping the performance metrics collection functions in a try/catch and logged out the error. This is the error we see - Undefined variable: performance.

It seems the Performance API is not supported at all in Opera Mini extreme data saving mode - https://caniuse.com/?search=performance

We get a moderate amount of traffic on this browser so it would be great if we could help expand support to this browser again. If supporting this browser is too tricky then consumers should be aware that they may have to handle errors coming from this package if they need to serve an audience that use Opera Mini.

Happy to help with this issue.

Thanks!

@philipwalton
Copy link
Member

Hmmm, I'm happy to add reasonable checks to avoid errors, but I can't actually reproduce this myself.

I've downloaded Opera Mini and turned on extreme data saver mode and I still see the global performance object. (Testing on OPR/60.0.2254.59405).

Do you know what version of Opera Mini you're seeing the error in?

@philipwalton
Copy link
Member

Update: after a bit more testing I discovered that I was seeing the global performance object only when testing a page on localhost (well, actually 192.168.X.X). When I tried loading the same page via a public web address, then I saw that indeed:

typeof performance === "undefined" // true

I'll publish a fix for this.

@philipwalton
Copy link
Member

The fix for this should be live in v2.1.1.

@jroebu14
Copy link
Contributor Author

jroebu14 commented Oct 7, 2021

Brilliant! Thanks for this!

The fact that you didn't see the error on localhost may be because Opera Mini uses a transcoding proxy server to retrieve light versions of websites. If you are testing on localhost then I don't think requests would go through the proxy server because it wouldn't be able to access anything on your local machine or network.

This explains in more detail https://maqentaer.com/devopera-static-backup/http/dev.opera.com/articles/view/opera-mini-and-javascript/index.html

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 a pull request may close this issue.

2 participants