Skip to content

Commit b425579

Browse files
EdgarChenmoz-wptsync-bot
authored andcommitted
Always consume user activation when opending a new window
Per whatwg/html#10547, we should always consume the user activation even if the popup blocker is disabled or the window has permission to open a new window. Differential Revision: https://phabricator.services.mozilla.com/D230331 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1930458 gecko-commit: a63ca42b209f7b7eb5d84a897d4f7a6efacbf98c gecko-reviewers: smaug
1 parent 4d21424 commit b425579

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

html/browsers/windows/consume-user-activation/window-open.html

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,19 @@
1515
testWin.close();
1616
});
1717
assert_false(navigator.userActivation.isActive, "User activation should be consumed");
18-
});
18+
}, "Opening a new window should consume user activation");
19+
20+
promise_test(async function(t) {
21+
await test_driver.bless("user activation");
22+
const testWin = window.open("/resources/blank.html", "testWindow");
23+
assert_false(navigator.userActivation.isActive, "User activation should be consumed");
24+
t.add_cleanup(() => {
25+
testWin.close();
26+
});
27+
28+
// Open the existing window again
29+
await test_driver.bless("user activation");
30+
const testWin2 = window.open("/resources/blank.html", "testWindow");
31+
assert_true(navigator.userActivation.isActive, "User activation should not be consumed");
32+
}, "Opening an existing window should not consume user activation");
1933
</script>

0 commit comments

Comments
 (0)