panzi/Browser-Ponies

For Android browsers, browserponies should not run.

Opened this issue · 4 comments

As has been witnessed by myself on several different instances, there is a problem where browserponies is executed on Android and low-resource mobile devices.

Android phones and some tablets do not have the system resources to properly load or render Browser Ponies.

To that end, the code should check the user-agent string, and if the user agent string contains "Android" it should automatically unload the browserponies scripts from memory and not attempt to run.

The below code can be used to get the user agent string.

$('#UserAgent').val(navigator.userAgent);

From this, the scripts should then scan the string for "Android" and on a find of that, prevent the scripts from loading. This will prevent low-resource Android devices from loading browserponies and will prevent device lockups which require a complete power down (through battery removal or otherwise) to resolve the lockup.

I suggest also checking the screen resolution (if that is possible and does not just return the size of the window), if it is too small the user is probably on a mobile device.

I believe that specifically getting pixel width and pixel height of the window itself should be satisfactory, though, if someone is loading the scripts within a small window on their system too, then this should not load, in order to actually allow the use of the site without the browser ponies getting in the way.

Sure, but if you have a large screen you could temporarly make it larger and turn it of. I do not have an opinion on whether to automatically disable it on small windows on large screens.

On Android i use Firefox, Browser Ponies works well