Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Switch Web Share Permissions Policy to *
https://bugs.webkit.org/show_bug.cgi?id=241363

Patch by Marcos Cáceres <marcos@marcosc.com> on 2022-06-12
Reviewed by Youenn Fablet and Tim Horton.

* LayoutTests/http/tests/webshare/webshare-allow-attribute-canShare.https-expected.txt:
* LayoutTests/http/tests/webshare/webshare-allow-attribute-canShare.https.html:
* LayoutTests/http/tests/webshare/webshare-allow-attribute-share.https-expected.txt:
* LayoutTests/http/tests/webshare/webshare-allow-attribute-share.https.html:
* Source/WebCore/html/FeaturePolicy.cpp:
(WebCore::FeaturePolicy::parse):

Canonical link: https://commits.webkit.org/251487@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295482 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
commit-queue@webkit.org committed Jun 13, 2022
1 parent ab59722 commit 97543a1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
@@ -1,9 +1,8 @@
CONSOLE MESSAGE: Feature policy 'WebShare' check failed for iframe with origin 'https://localhost:8443' and allow attribute ''.
CONSOLE MESSAGE: Feature policy 'WebShare' check failed for iframe with origin 'https://localhost:8443' and allow attribute 'web-share 'none''.
CONSOLE MESSAGE: Feature policy 'WebShare' check failed for iframe with origin 'https://127.0.0.1:8443' and allow attribute 'web-share 'none''.
CONSOLE MESSAGE: Feature policy 'WebShare' check failed for iframe with origin 'https://localhost:8443' and allow attribute 'web-share 'self''.
CONSOLE MESSAGE: Feature policy 'WebShare' check failed for iframe with origin 'https://127.0.0.1:8443' and allow attribute 'web-share https://localhost:8443'.
PASS iframe src: "https://localhost:8443/webshare/resources/webshare-postmessage.html" with allow="" MUST NOT be allowed to call canShare().
PASS iframe src: "https://localhost:8443/webshare/resources/webshare-postmessage.html" with allow="" is allowed to call canShare().
PASS iframe src: "https://127.0.0.1:8443/webshare/resources/webshare-postmessage.html" with allow="" is allowed to call canShare().
PASS iframe src: "https://localhost:8443/webshare/resources/webshare-postmessage.html" with allow="web-share" is allowed to call canShare().
PASS iframe src: "https://127.0.0.1:8443/webshare/resources/webshare-postmessage.html" with allow="web-share" is allowed to call canShare().
Expand Down
Expand Up @@ -48,7 +48,7 @@
</head>
<body>
<iframe
data-enabled="false"
data-enabled="true"
src="https://localhost:8443/webshare/resources/webshare-postmessage.html"
></iframe>
<iframe
Expand Down
@@ -1,9 +1,8 @@
CONSOLE MESSAGE: Feature policy 'WebShare' check failed for iframe with origin 'https://localhost:8443' and allow attribute ''.
CONSOLE MESSAGE: Feature policy 'WebShare' check failed for iframe with origin 'https://localhost:8443' and allow attribute 'web-share 'none''.
CONSOLE MESSAGE: Feature policy 'WebShare' check failed for iframe with origin 'https://127.0.0.1:8443' and allow attribute 'web-share 'none''.
CONSOLE MESSAGE: Feature policy 'WebShare' check failed for iframe with origin 'https://localhost:8443' and allow attribute 'web-share 'self''.
CONSOLE MESSAGE: Feature policy 'WebShare' check failed for iframe with origin 'https://127.0.0.1:8443' and allow attribute 'web-share https://localhost:8443'.
PASS iframe src: "https://localhost:8443/webshare/resources/webshare-postmessage.html" with allow="" MUST NOT be allowed to call share(). NotAllowedError Third-party iframes are not allowed to call share() unless explicitly allowed via Feature-Policy (web-share)
PASS iframe src: "https://localhost:8443/webshare/resources/webshare-postmessage.html" with allow="" is allowed to call share().
PASS iframe src: "https://127.0.0.1:8443/webshare/resources/webshare-postmessage.html" with allow="" is allowed to call share().
PASS iframe src: "https://localhost:8443/webshare/resources/webshare-postmessage.html" with allow="web-share" is allowed to call share().
PASS iframe src: "https://127.0.0.1:8443/webshare/resources/webshare-postmessage.html" with allow="web-share" is allowed to call share().
Expand Down
Expand Up @@ -26,7 +26,7 @@

const iframeDetails = [
{
enabled: "false",
enabled: "true",
src: "https://localhost:8443/webshare/resources/webshare-postmessage.html",
},
{
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/html/FeaturePolicy.cpp
Expand Up @@ -288,7 +288,7 @@ FeaturePolicy FeaturePolicy::parse(Document& document, const HTMLIFrameElement&
if (!isPaymentInitialized)
policy.m_paymentRule.allowedList.add(document.securityOrigin().data());
if (!isWebShareInitialized)
policy.m_webShareRule.allowedList.add(document.securityOrigin().data());
policy.m_webShareRule.type = FeaturePolicy::AllowRule::Type::All;
#if ENABLE(DEVICE_ORIENTATION)
if (!isGyroscopeInitialized)
policy.m_gyroscopeRule.allowedList.add(document.securityOrigin().data());
Expand Down

0 comments on commit 97543a1

Please sign in to comment.