Closed Bug 2082264 Opened 1 month ago Closed 1 month ago

[wpt-sync] Sync PR 63668 - [WebInstallAPI] Restrict navigator.install to secure contexts

Categories

(Testing :: web-platform-tests, task, P4)

task

Tracking

(firefox160 fixed)

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 63668 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/63668
Details from upstream follow.

Lia Hiscock <liahiscock@microsoft.com> wrote:

[WebInstallAPI] Restrict navigator.install to secure contexts

Apply SecureContext to both navigator.install overloads so the API is
absent from insecure contexts, including HTTPS frames with an insecure
ancestor. Preserve exposure on HTTPS and trustworthy HTTP localhost.

Define is_in_secure_context in the binding generator's callback scope.
Secure-gated overload dispatch references this symbol, but the missing
binding previously caused generation to fail.

Bug: 333795265
Change-Id: I05ab5417fe55e554918f69c0963861e275756c76
Include-Ci-Only-Tests: chromium.mac:mac26-arm64-rel-tests|browser_tests
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8544380
Reviewed-by: Robert Paveza \<Rob.Paveza@microsoft.com>
Reviewed-by: David Baron \<dbaron@chromium.org>
Commit-Queue: Lia Hiscock \<liahiscock@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1719173}

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 5 tests and 3 subtests

Status Summary

Firefox

OK : 2[GitHub] 5[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS: 2
FAIL: 1[GitHub] 17[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]

Chrome

OK : 2
PASS: 1
FAIL: 2

Safari

OK : 2
PASS: 2
FAIL: 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /web-install/navigator-install-bad-inputs.tentative.https.html [wpt.fyi]
    • navigator.install(url) rejects with TypeError.: FAIL
    • navigator.install(url, manifestId) rejects with TypeError.: FAIL
    • navigator.install({}) rejects with TypeError when manifest is missing.: FAIL
    • navigator.install({manifest: ""}) rejects with TypeError for empty manifest URL.: FAIL
    • navigator.install({manifest: " \t\n "}) rejects with TypeError for a whitespace-only manifest URL.: FAIL
    • navigator.install({manifest: "https://["}) rejects with TypeError for invalid manifest URL.: FAIL
    • navigator.install({manifest, manifestId: ""}) rejects with TypeError for empty manifestId.: FAIL
    • navigator.install({manifest, manifestId: " \t\n "}) rejects with TypeError for whitespace-only manifestId.: FAIL
    • navigator.install({manifest, manifestId: "https://["}) rejects with TypeError for invalid manifestId.: FAIL
    • navigator.install({installurl}) rejects with TypeError when manifest is missing.: FAIL
  • /web-install/navigator-install-defined.tentative.https.html [wpt.fyi]
    • navigator.install() is defined.: FAIL (Chrome: PASS, Safari: FAIL)
  • /web-install/navigator-install-sandboxed-iframe.tentative.https.html [wpt.fyi]
    • navigator.install() in sandboxed iframe (allow-scripts) should throw SecurityError.: FAIL
    • navigator.install() in sandboxed iframe (allow-scripts allow-same-origin) should throw SecurityError.: FAIL
    • navigator.install() in a same-origin iframe should throw InvalidStateError.: FAIL
  • /web-install/navigator-install-user-activation.tentative.https.html [wpt.fyi]
    • navigator.install() rejects with NotAllowedError without a user activation.: FAIL
    • navigator.install({manifest}) rejects with NotAllowedError without a user activation.: FAIL
    • navigator.install({manifest, installurl}) ignores installurl and rejects with NotAllowedError without a user activation.: FAIL
Pushed by wptsync@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/da83c719a6a9 https://hg.mozilla.org/integration/autoland/rev/ea476a73b1d4 [wpt PR 63668] - [WebInstallAPI] Restrict navigator.install to secure contexts, a=testonly
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
You need to log in before you can comment on or make changes to this bug.