New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 734493 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Long OOO (go/where-is-mgiuca)
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 1
Type: Bug



Sign in to add a comment

Web Share: navigator.share should be undefined in secure contexts (instead of runtime error)

Project Member Reported by mgiuca@chromium.org, Jun 19 2017

Issue description

Chrome Version: 61
OS: All

What steps will reproduce the problem?
(1) Turn on chrome://flags#enable-experimental-web-platform-features.
(2) Visit http://wicg.github.io/web-share/demos/share.html
(3) Click Share

What is the expected result?
Error: Unsupported feature: navigator.share

What happens instead?
Error sharing: SecurityError: Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).

The IDL should have [SecureContext] on the method, rather than having a manual check at call time that it is in a secure context. [Spec compliance: https://wicg.github.io/web-share/#navigator-interface]
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/412b83e035b1d81ae7e4b38f8d21c3976f8aec46

commit 412b83e035b1d81ae7e4b38f8d21c3976f8aec46
Author: Matt Giuca <mgiuca@chromium.org>
Date: Wed Jun 21 00:42:03 2017

navigator.share: Hide method entirely on non-secure context.

Previously, the method was visible, but calling it resulted in a
SecurityError. Now it is simply gone (via [SecureContext] in the IDL).

This brings the implementation in line with the draft spec at
https://wicg.github.io/web-share.

Bug:  734493 
Change-Id: Ia246108fd7441f9b93bb0cbcf6a6fda4562d3a55
Reviewed-on: https://chromium-review.googlesource.com/541255
Commit-Queue: Matt Giuca <mgiuca@chromium.org>
Reviewed-by: Sam McNally <sammc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#481048}
[modify] https://crrev.com/412b83e035b1d81ae7e4b38f8d21c3976f8aec46/third_party/WebKit/LayoutTests/http/tests/security/powerfulFeatureRestrictions/webshare-on-insecure-origin.html
[modify] https://crrev.com/412b83e035b1d81ae7e4b38f8d21c3976f8aec46/third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp
[modify] https://crrev.com/412b83e035b1d81ae7e4b38f8d21c3976f8aec46/third_party/WebKit/Source/modules/webshare/NavigatorShare.idl

Status: Fixed (was: Assigned)

Sign in to add a comment