-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1795658 [wpt PR 36491] - [beacon-api] Allow only HTTPS targets an…
…d make API secure-context only, a=testonly Automatic update from web-platform-tests [beacon-api] Allow only HTTPS targets and make API secure-context only According to the [discussion][1], this CL makes the API only available in [secure context][2], and blocks all non-HTTPS request URLs in the PendingBeacon API: 1. The API throws `TypeError` when url provided to the following APIs are not HTTPs. Note that relative URLs or URLs without schema still work: A. ctor: `PendingGetBeacon(url)` & `PendingPostBeacon(url)` B. `PendingGetBeacon.setURL(url)` 2. The entire `PendingBeacon` API becomes only available in SecureContext, i.e. on an HTTPS page. [1]: WICG/pending-beacon#27 [2]: https://w3c.github.io/webappsec-secure-contexts/ Bug: 1293679 Change-Id: I20b2ece0fe490decea80ead6f4740b65c9a36845 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3955986 Reviewed-by: Rakina Zata Amni <[email protected]> Reviewed-by: Daniel Cheng <[email protected]> Commit-Queue: Ming-Ying Chung <[email protected]> Cr-Commit-Position: refs/heads/main@{#1063911} -- wpt-commits: 97cd7633f583bff5b856f816eba1de189c7c3903 wpt-pr: 36491
- Loading branch information
1 parent
c5f4423
commit 2620dfa
Showing
6 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
testing/web-platform/tests/pending-beacon/pending_beacon-basic.window.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// META: script=/resources/testharness.js | ||
// META: script=/resources/testharnessreport.js | ||
|
||
'use strict'; | ||
|
||
test(() => { | ||
assert_false(window.hasOwnProperty('PendingGetBeacon')); | ||
}, `PendingGetBeacon is not supported in non-secure context.`); | ||
|
||
test(() => { | ||
assert_false(window.hasOwnProperty('PendingPostBeacon')); | ||
}, `PendingPostBeacon is not supported in non-secure context.`); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.