enforcing webShare policy for self
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
People
(Reporter: karlcow, Unassigned)
References
()
Details
On https://github.com/webcompat/web-bugs/issues/68473
Steps to Reproduce:
- Navigate to https://code.or.jp/news/3075/
- Scroll down the page until reaching the video.
- Drag the page to the right, in order for "Watch later" and "Share" buttons to be visible.
- Tap "Share" button.
- Observe behavior.
Expected Behavior:
A popup containing sharing services is displayed allowing the video to be shared.
Actual Behavior:
Nothing happens, video can't be shared.
Notes:
- The video is shared on Chrome.
- The video is from an iframe from youtube.
The code on this specific site is
g.WN.prototype.onClick = function () {
var a = this.api.T(),
b = this.api.getVideoData(this.api.getPresentingPlayerType()),
c = this.api.getPlaylistId();
a = a.getVideoUrl(b.videoId, c, void 0, !0);
if (navigator.share) try {
var d = navigator.share({
title: b.title,
url: a
});
d instanceof Promise && d.catch(woa)
} catch (e) {
e instanceof Error && woa(e)
} else this.i.Cl(),
OM(this.u, this.element, !1);
this.api.Kb(this.element)
};
and the error message is:
Uncaught (in promise) DOMException: Navigator.share: Document's Permission Policy does not allow calling share() from this context.
Trying to find information here and there.
- Force transient activation in iframes which is about being able to test in WPT the webshare in the context of iframes.
- Mike Taylor says that the site needs
Permissions-Policy: web-share=(self "https://www.youtube.com") header
for working but that maybe Chrome ignores it. - This is the chromium bug implementing WebShare with feature policy
- Web-share feature policy at W3C
Comment 1•4 years ago
|
||
Dylan is this a GV level issue or do you think it is in AC?
Comment 2•4 years ago
|
||
(In reply to Emily Toop (:fluffyemily) from comment #1)
Dylan is this a GV level issue or do you think it is in AC?
Honestly it looks like a Gecko issue (or non-issue)? We hit this case here: https://searchfox.org/mozilla-central/source/dom/base/Navigator.cpp#1384, well before reaching GV code. And from the W3C discussion, it looks like blocking webshare here is intended: https://bugzilla.mozilla.org/show_bug.cgi?id=1653199
Reporter | ||
Comment 3•4 years ago
|
||
Yes it seems that chrome has an issue here, according to Mike up there.
Let's make a round of contact with Chrome Engineers and see the status.
Updated•4 years ago
|
Reporter | ||
Comment 4•4 years ago
|
||
Reporter | ||
Updated•4 years ago
|
Description
•