Automatic update from web-platform-tests [WebInstallAPI] Add navigator.install manifest url support and plumbing Introduce a new `install()` entry point that accepts an `InstallParams` dictionary, enabling installation of a web app from its manifest URL rather than from a document install URL. Mark the existing `install_url`-based code paths with TODOs for follow-up cleanup once the manifest-based API is fully landed. - Add `InstallParams` IDL dictionary with a required `manifest` member and an optional `id` member, and expose a matching `install(params)` overload on `Navigator`. - Add `ManifestInstallOptions` and `InstallFromManifest()` to the `WebInstallService` Mojo interface; eliminate manifest id from the result for privacy reasons. - Implement `NavigatorWebInstall::InstallFromParamsImpl()` to validate preconditions, require a transient user activation, parse and validate `manifest` and optional `id`, and dispatch the request to the browser. - Stub out `WebInstallServiceImpl::InstallFromManifest()` - Update `HTMLInstallElement` test fake to satisfy the new interface method. Dev doc - https://docs.google.com/document/d/1rGvLhD4SR8Y9M1wVmqgyesPNkbZGU7HOqlttjEFJ5Vo/edit?tab=t.eiywj6swkfs6#bookmark=id.axc7sk5axe17 Bug: 333795265 Change-Id: I404736594f3c07af279b493ddef6dad676e4f396 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7903790 Reviewed-by: Mike West <mkwst@chromium.org> Commit-Queue: Lia Hiscock <liahiscock@microsoft.com> Reviewed-by: Lu Huang <luhua@microsoft.com> Reviewed-by: Daniel Murphy <dmurph@chromium.org> Cr-Commit-Position: refs/heads/main@{#1649184} -- wpt-commits: fb83e524cf722ecfbf87c0ea1af5a79e963f271f wpt-pr: 60719
42 lines
1.7 KiB
HTML
42 lines
1.7 KiB
HTML
<!DOCTYPE html>
|
|
<title>navigator.install() requires user activation</title>
|
|
<link rel="help" href="https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/WebInstall/explainer.md">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<body>
|
|
<script>
|
|
promise_test(async function(t) {
|
|
await promise_rejects_dom(t, 'NotAllowedError', navigator.install(),
|
|
'navigator.install() without user activation should reject with ' +
|
|
'NotAllowedError');
|
|
}, 'navigator.install() rejects with NotAllowedError without a user ' +
|
|
'activation.');
|
|
|
|
promise_test(async function(t) {
|
|
await promise_rejects_dom(t, 'NotAllowedError',
|
|
navigator.install('https://example.com'),
|
|
'navigator.install(url) without user activation should reject with ' +
|
|
'NotAllowedError');
|
|
}, 'navigator.install(url) rejects with NotAllowedError without a user ' +
|
|
'activation.');
|
|
|
|
promise_test(async function(t) {
|
|
await promise_rejects_dom(t, 'NotAllowedError',
|
|
navigator.install('https://example.com', 'https://example.com'),
|
|
'navigator.install(url, id) without user activation should reject ' +
|
|
'with NotAllowedError');
|
|
}, 'navigator.install(url, manifest_id) rejects with NotAllowedError ' +
|
|
'without a user activation.');
|
|
|
|
promise_test(async function(t) {
|
|
await promise_rejects_dom(t, 'NotAllowedError',
|
|
navigator.install({
|
|
manifest: 'https://example.com/manifest.json',
|
|
}),
|
|
'navigator.install({manifest}) without user activation should reject ' +
|
|
'with NotAllowedError');
|
|
}, 'navigator.install({manifest}) rejects with NotAllowedError without a ' +
|
|
'user activation.');
|
|
</script>
|
|
</body>
|