Vibration API(developer.mozilla.org)
developer.mozilla.org
Vibration API
https://developer.mozilla.org/en-US/docs/Web/API/Vibration_API
61 comments
I use it in one of my web games. It's fully optional but people like to enable it. I wish it worked on iOS. Let's not vilify a perfectly good API just because some jerks use it to annoy users - there's a lot of value in having haptic feedback whether you're building a native app or a web app.
Exactly. Vibration, or tactile feedback, is very helpful for on-screen keyboards (it’s one of the feature that makes Free42 great), but I can’t use that in a web app which is frustrating.
Or just put it behind a permission prompt and quit ruining all the cool features of the web for the rest of us
I cannot think of a single time I want my phone to start vibrating in a web context outside of a very deep game integration.
This and many other features need to be bundled up behind a single permission prompt that gives the domain permission to be an app instead of a web site—and that permission should probably come with stricter restrictions on loading third-party resources.
It would be tough to make such a thing work because then every site would annoy you into being an app.
In Chrome, there's already a toolbar displaying that you can install the website as PWA. In addition, a lot of websites already try to stop you from using the web in favour of using the app (e. g. Reddit). So, I don't see this as a new annoyance.
Hence why the invasive permissions need to be paired with restrictions that impose a tradeoff and incentivize sites with a more traditional web page usage model to not classify themselves as app-style sites.
I can't think of a single time I wanted to allow push notifications or allow for my camera or mic to be accessed, but I can at least acknowledge that others may want this.
"Very deep"... is that subtle innuendo?
No. It isn't. And this isn't the place for that.
Edit: I was thinking of simulation gaming, such as racing (forced feedback, hitting the wall), Fishing (fish on the line, rumble as forced feedback, etc)
Edit: I was thinking of simulation gaming, such as racing (forced feedback, hitting the wall), Fishing (fish on the line, rumble as forced feedback, etc)
This is 100% the place for that. On the XBox Live Indie Games marketplace, the top-selling game was always a "scalp massager" game (or "game") of some sort.
I think previous poster is saying this is not really the place for titillating innuendo, or low effort jokes about such, which I’d tend to agree.
And I'm saying that teledildonics is a fascinating and rewarding area of consumer tech that 100% deserves a visible place on HN without resorting to hints and innuendo.
This is done with a lot of features already: In practice, users click to authorize it, and then do not understand why their computers do scary things. Just putting stuff behind yet another permission prompt users do not understand is not an acceptable position.
I really feel a lot of people in Silicon Valley have not ever just sat back and watched a non-technical user use a computer: The state of the industry is woefully disconnected from actual user experience. I beseech anyone who thinks a permission prompt solves a problem, rather than creating one, to go to a senior living community, and just watch people use computers.
I really feel a lot of people in Silicon Valley have not ever just sat back and watched a non-technical user use a computer: The state of the industry is woefully disconnected from actual user experience. I beseech anyone who thinks a permission prompt solves a problem, rather than creating one, to go to a senior living community, and just watch people use computers.
> go to a senior living community, and just watch people use computers.
Experiences like this make me wish there were chromebook like machines that didn't spy on users, because that's really the only ethical solution.
Non-technical users can have the locked down machines, with a way to opt in to a higher degree of access possibly, and power users can get the full machines.
I know this sounds elitist of me, but this is the only way I honestly see everyone getting what they want.
Experiences like this make me wish there were chromebook like machines that didn't spy on users, because that's really the only ethical solution.
Non-technical users can have the locked down machines, with a way to opt in to a higher degree of access possibly, and power users can get the full machines.
I know this sounds elitist of me, but this is the only way I honestly see everyone getting what they want.
Having it without a prompt is also not a acceptable situation.
I think HTML should be split in web sites, and applications. If a page wants to use the camera, or vibration, etc., it should take you to "Programs & Features" or the Apps settings and say:
"This website XXX is a program, not a page. Do you want to install this program?"
I would even consider make the list of "programs" visible at all times on the edge of the last start screen page, and limit it to 12 programs or so, in order to prevent people from installing all kinds of junk.
I think HTML should be split in web sites, and applications. If a page wants to use the camera, or vibration, etc., it should take you to "Programs & Features" or the Apps settings and say:
"This website XXX is a program, not a page. Do you want to install this program?"
I would even consider make the list of "programs" visible at all times on the edge of the last start screen page, and limit it to 12 programs or so, in order to prevent people from installing all kinds of junk.
> I think HTML should be split in web sites, and applications.
You have reinvented native apps
You have reinvented native apps
The problem is that it isn't out place to decide that people simply aren't allowed to do something because they are too stupid or senile to be even given the option to do something they might actively want... I appreciate the intent, but the result still feels morally reprehensible (and I will note that, if it had been applied to computers from the beginning, most of the cool stuff we use wouldn't exist).
I think it's a big stretch to say leaving the ability for a website to vibrate your phone out of the web standard is "morally reprehensible". Nor am I suggesting users are too stupid or senile: They just care less about the plumbing than the plumbers do.
The problem is when all your user experience studies grab folks from tech communities, you start to think people can or want to cope with your constantly evolving stack of features, when they probably just want to find out how to get to a restaurant that day.
The problem is when all your user experience studies grab folks from tech communities, you start to think people can or want to cope with your constantly evolving stack of features, when they probably just want to find out how to get to a restaurant that day.
I’m totally fine with having features like this living in website settings but it should be non-promptable.
> Or just put it behind a permission prompt
There are now dozens of APIs requiring a permission prompt. Enough.
There are now dozens of APIs requiring a permission prompt. Enough.
It boggles my mind why this doesn't require any permission. Every now and then I misclick on some sketchy ads and it's always the loud alert ringtone + alert popup + back navigation hijacking + my phone vibrating non-stop. I've never seen this vibration "feature" used for anything legitimate on the web, ever.
So there are still ads in the web? Thanks for the reminder. You really forget about that behind ff+ublock...
I've been using DuckDuckGo's Privacy Browser. It has made the mobile web far more pleasant to use.
My favorite are the sites that somehow fill your browser history such that you can’t push the “back” button fast enough. No idea why browsers allow this.
A recent dark pattern I’ve seen is for news websites to add their home page to the history stack when you click a link to an article anywhere on that site so that tapping back doesn’t take you back to the page you were linked from.
if you long press it, you'll get a list of sites, so you can just skip back multiple at once
Yes, but every item in that list is the spam link, so what’s the point?
Browsers allow it because it's needed for single page apps and history-aware modals to function properly.
How do you suggest web apps can be granted native app-like abilities, then, if not via a standardized browser API? PWA's are a thing, and arguably the future of app development (including wearable computers, the next big thing). If not: Least companies can afford to develop native solutions for every single manufacturer, granted there will be more than one. We'll be stuck with solutions like Cordova forever. A grim prospect on the future.
Another comment suggests bundled permissions for elevated apps, with a simpler prompt, if any. I think this is the inevitable way to go.
Another comment suggests bundled permissions for elevated apps, with a simpler prompt, if any. I think this is the inevitable way to go.
[deleted]
Why do you assume that is desirable? And why should PWAs be a thing?
There are many reasons PWAs should be a thing, but one of the most important reasons is to be able to deploy apps to phones without needing to go through the app stores and complicated deployment setups.
I don't buy it for a second, and if that truly is one of the most important reasons for it then that just reinforces my belief that it should not exist.
Also, maybe the important thing is to not buy into walled gardens that have stores with complicated deployment setups in the first place?
Also, maybe the important thing is to not buy into walled gardens that have stores with complicated deployment setups in the first place?
>Also, maybe the important thing is to not buy into walled gardens that have stores with complicated deployment setups in the first place?
You mean like having a standard cross-device open and uncontrolledly platform for running your application on any mobile device? Oh wait a second...
You mean like having a standard cross-device open and uncontrolledly platform for running your application on any mobile device? Oh wait a second...
If your are against walled gardens, why are you also against making the web more powerful so it has a chance to compete with native apps?
You don’t have control over what phone your userbase uses.
I’ve built multiple pwa’s for companies and organisations, mainly for internal tools. It worked very well and we were happy we didn’t have to deploy to different app stores, while still being able to leverage the device’s api.
Can you explain why having more options to offer apps to users is a bad thing?
I’ve built multiple pwa’s for companies and organisations, mainly for internal tools. It worked very well and we were happy we didn’t have to deploy to different app stores, while still being able to leverage the device’s api.
Can you explain why having more options to offer apps to users is a bad thing?
Yes I got something similar served through Google's own ad network. That served as the catalyst for my switching to Firefox (with uBlock Origin).
I’m not surprised that this isn’t supported in mobile Safari.
look. i get it. the problem is, EVERYONE starts abusing this left and right. remember notifications? i have it set to off by default because every news, every blog every publication wants me to turn on notifications for them only because of "breaking news" and other BS.
go and see how chrome does it. its on by default and imo people are tricked into accepting those willy nilly. the result? i know people whose right side is littered with "offers" and "breaking news" and "see your horoscope". the worst part, i have had the time to help them get this shit off their computers and it is tiring. you have to disable each and every website one by one in the notifications, its like they don't want you to try. sure there is a general disable button but what if you want to disable all but one? have chromium developers heard about "checkbox and bulk actions"? https://www.howtogeek.com/725208/how-to-turn-off-pop-up-noti...
go and see how chrome does it. its on by default and imo people are tricked into accepting those willy nilly. the result? i know people whose right side is littered with "offers" and "breaking news" and "see your horoscope". the worst part, i have had the time to help them get this shit off their computers and it is tiring. you have to disable each and every website one by one in the notifications, its like they don't want you to try. sure there is a general disable button but what if you want to disable all but one? have chromium developers heard about "checkbox and bulk actions"? https://www.howtogeek.com/725208/how-to-turn-off-pop-up-noti...
Pretty sure this API has been around for 8+ years and is likely at risk of deprecation. No, nobody used it, no it didn’t destroy the internet.
Nobody used it because it didn't work on most browsers.
It works on Chrome, so that's most of the world's smartphones. Desktop support is obviously lacking, though you might be able to write an extension to forward vibrations to an attached games controller?
Luckily, all the fancy web devs use iPhones so they probably don't even know about features like these, which helps in them not getting abused to hell.
I've seen it used twice, once for physical feedback when using hassio (really nice) and once with one of those shitty scam ads (really awful). I was surprised that there wasn't a permission prompt for this API.
Luckily, all the fancy web devs use iPhones so they probably don't even know about features like these, which helps in them not getting abused to hell.
I've seen it used twice, once for physical feedback when using hassio (really nice) and once with one of those shitty scam ads (really awful). I was surprised that there wasn't a permission prompt for this API.
Wasn't the API actively abandoned already because it was only use by ads?
I recently tried Xbox game streaming in the browser and it works better than I expected. The only thing missing is haptic feedback. Are there games in the browser or streaming services that support haptic feedback?
Wrote a bomberman clone for the browser once and wanted to habe some rumble for the explosions.
Turned out, the game controller APIs doesn't support controller vibrations.
Turned out, the game controller APIs doesn't support controller vibrations.
I really hope this is based on a per-page user-given permission, same as access to audio/video capturing...
Because if it isn't, any piece of adware code that loads onto the phone, would be able to run the tiny rotational-unbalance based mechanism within the phone for however long and in whatever fashion it sees fit.
As if phone batteries didn't run down fast enough already...
Because if it isn't, any piece of adware code that loads onto the phone, would be able to run the tiny rotational-unbalance based mechanism within the phone for however long and in whatever fashion it sees fit.
As if phone batteries didn't run down fast enough already...
If you click the small down-arrows on the Browser Compatibility chart, you can see the details about each browser that supports it. Most of them require a "user gesture", which is not as good as asking permission IMO but better than nothing. Firefox for Android used to ask permission, but for the last two years it just doesn't support this at all.
There is a bug report for that. It's not been moving at all since it was opened https://github.com/mozilla-mobile/fenix/issues/2371
I wanted to try it out and... there is no easy way to execute JS on an Android phone with Chrome, unlike on a laptop.
Use websites like JSFiddle & co is probably the way to go.
Here's what I used to test it: https://googlechrome.github.io/samples/vibration/
Here's a library that has some effects to test as well: https://www.hapticsjs.org/
Looks like the vibration on phones only has a single strength setting, unlike those in gamepads.
Looks like the vibration on phones only has a single strength setting, unlike those in gamepads.
Can this be used with my lovense? jk
missed integration opportunity? https://buttplug.io/
Fun fact: I was a developer at Mozilla when this API was announced, and was slated to possibly work on it, for Obvious Reasons.
Would be useful for this: https://busysimulator.com/
Except that there's no support for the vibration API on Firefox for Android.
Except that there's no support for the vibration API on Firefox for Android.
[deleted]
Take this out back and put it down next to the blink tag and chained alerts without auto dismissal.