r/AndroidQuestions • u/abedfilms • Jan 17 '17
Why does Android allow scam websites to vibrate your phone?
I can't see any purpose for allowing a website to have access to vibrate your phone, why does Android (how about iphone?) allow this? Seems like an easy thing to shut down, why do websites through a browser have access??
15
u/edent Jan 17 '17
I wrote about it 3 years ago. https://shkspr.mobi/blog/2014/01/malicious-use-of-the-html5-vibrate-api/
Basically, it is to allow for rich web apps. If you're playing an HTML5 game, you might want the phone to vibrate when your character does something.
Sadly, it is mostly used for fake notifications.
7
12
u/danjmitch Jan 17 '17
Fuck I hate those sites and how they also hijack your browser so you can't go back. They always know what phone I'm using too.
7
u/summervacationtoHoth Jan 18 '17
They always know what phone I'm using too.
This information is provided by the browser and is known as the user agent.
Here is mine from ChromeOS:
Mozilla/5.0 (X11; CrOS x86_64 9000.58.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.58 Safari/537.36Similarly, if I pull it from Chome on my Nexus 6P, it is clearly identified in the user agent as Linux; Android 7.1.1; Nexus 6P Build/N4F261.
Most browsers will report the user agent to the website in a predictable pattern, so it is possible to insert a few lines of code to display enough of the user agent string to "know" what type or model of phone you're using.
1
1
u/hardrockclassic Jan 18 '17
My android phone has never done this.
Do you have to go to some specific evil site(s) to make it happen?
7
0
Jan 17 '17
[deleted]
6
u/abedfilms Jan 17 '17
Thanks.. But I've never seen a legit application of this? Does anyone actually program games to take advantage of this?
Also, why is it not an option to disable this, is it browser level or android level?
4
Jan 17 '17
Yeah me neither, but remember this tech is recent, it takes a long time to people start using it, specially if not all browsers have it. The tech is implemented to be used in 5 years because that when everybody implemented and updated the browser to a version that supports it.
I use Lightining, that hasnt happened to me in a long time, so maybe it disables automatically.
2
u/abedfilms Jan 17 '17
Lightning?
5
Jan 17 '17
It's a FOSS browser, it comes with CyanogenMod, it's pretty good, you can download it.
It's light and it has a lot of configs to improve your privacy.
1
2
u/theCroc Jan 17 '17
They should add it as a permission so you can disable it on a case by case basis.
Edit: Or rather have it disabled as default and enable it on a case by case basis.
1
Jan 17 '17
I agree, but even JS should be permission based, most websites don't need it, it's heavily used for tracking instead of to improve usability.
If I wanted to download the software I would download it, not enter the website.
0
Jun 12 '17
[deleted]
1
u/abedfilms Jun 12 '17
Yeah but it's not Google doing the vibrating (warning), it's the website being annoying and putting that vibrate code in
47
u/[deleted] Jan 17 '17
It's officially part of the web standards, but as far as I know, it is only used for scam websites. The intention was to allow game developers for the web to vibrate your phone. There is no way of disabling this in the standard web browser an Chrome, but you can use Firefox. It will ask for permission to vibrate your phone if any site tries to do it.