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

Block navigator.vibrate in cross-origin iframes #15

Open
dontcallmedom opened this issue Aug 19, 2016 · 4 comments
Open

Block navigator.vibrate in cross-origin iframes #15

dontcallmedom opened this issue Aug 19, 2016 · 4 comments

Comments

@dontcallmedom
Copy link
Member

Chrome is blocking the vibration API in cross-origin iframes.

The current spec allows for that behaviour, but if that's the one other browsers are converging toward, we should probably make it the explicitly required behaviour.

@lknik
Copy link

lknik commented Aug 21, 2016

I believe this is a good idea - at least document it as an option. Even better, a requirement.

@annevk
Copy link
Member

annevk commented Nov 13, 2019

Firefox is also doing this: https://bugzilla.mozilla.org/show_bug.cgi?id=1591113.

@anssiko
Copy link
Member

anssiko commented Nov 13, 2019

Seems we should make this normative.

@annevk is there a less convoluted way to spec this than what is proposed below?

Replace the following step 1 in perform vibration:

An implementation MAY return false and terminate these steps.

With:

If this Navigator object's relevant global object's associated Document's browsing context's active document's origin is not same origin-domain with the origin of the current settings object of this Navigator object, return false and terminate these steps.

@annevk
Copy link
Member

annevk commented Nov 13, 2019

It might be worthwhile to wait on whatwg/html#4966 at which point we can define a primitive such as "is a top-level origin" which you give an origin and then it returns true or false. Or perhaps even "has a top-level origin" which you can give some kind of object and it takes it from there.

We'll need this for a large number of features.

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

No branches or pull requests

4 participants