Closed Bug 1701841 Opened 4 years ago Closed 4 years ago

enforcing webShare policy for self

Categories

(Core :: DOM: Core & HTML, defect)

Firefox 89
Unspecified
All
defect

Tracking

()

RESOLVED WONTFIX
Webcompat Priority ?
Tracking Status
firefox89 --- affected

People

(Reporter: karlcow, Unassigned)

References

()

Details

On https://github.com/webcompat/web-bugs/issues/68473

Steps to Reproduce:

  1. Navigate to https://code.or.jp/news/3075/
  2. Scroll down the page until reaching the video.
  3. Drag the page to the right, in order for "Watch later" and "Share" buttons to be visible.
  4. Tap "Share" button.
  5. 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.

See Also: → webshare

Dylan is this a GV level issue or do you think it is in AC?

Flags: needinfo?(droeh)

(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

Flags: needinfo?(droeh)

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.

Component: General → DOM: Core & HTML
Product: GeckoView → Core

:karlcow: can we then close this ticket?

Flags: needinfo?(kdubost)
Status: NEW → RESOLVED
Closed: 4 years ago
Flags: needinfo?(kdubost)
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.