Add support for "promptUnload" argument for "browsingContext.close" command
Categories
(Remote Protocol :: WebDriver BiDi, enhancement, P2)
Tracking
(firefox129 fixed)
Tracking | Status | |
---|---|---|
firefox129 | --- | fixed |
People
(Reporter: whimboo, Assigned: whimboo)
References
(Blocks 2 open bugs, )
Details
(Whiteboard: [webdriver:m11][wptsync upstream][webdriver:relnote])
Attachments
(2 files)
The promptUnload
argument has recently been added to the browsingContext.close
command via https://github.com/w3c/webdriver-bidi/pull/518. This allows to control if a beforeunload
prompt should be shown or not.
I've asked for some tests and will add a downstream sync bug as dependency once a PR on the wpt repository has been created.
Assignee | ||
Updated•11 months ago
|
Assignee | ||
Comment 1•11 months ago
•
|
||
Right now we do not support beforeunload
prompts at all in Marionette. So these need to be enabled first, before we can add support for it in WebDriver BiDi via bug 1824220.
Assignee | ||
Updated•9 months ago
|
Assignee | ||
Updated•9 months ago
|
Assignee | ||
Comment 2•9 months ago
|
||
Wdspec tests will be added upstream via bug 1874748.
Assignee | ||
Updated•8 months ago
|
Updated•7 months ago
|
Assignee | ||
Comment 3•4 months ago
|
||
To properly write tests for the prompt opened and prompt closed feature on bug 1824220 I need support for this argument. The upstream wpt tests aren't done yet, so I've asked for them to get finished. If it takes longer we could land the patch anyway given that we need this feature when testing pages where we dismiss the beforeunload prompt.
Assignee | ||
Comment 4•4 months ago
|
||
Assignee | ||
Comment 5•4 months ago
|
||
With the patch applied network event related wdspec tests are failing.
After investigation it can be seen that the service worker test, which runs before, seems to cause an invalid response to be sent. But that only when I call removeTab
with the skipPermitUnload
field set to true
. Here is what we get when it fails:
{
'context': '5be553b8-3e45-4952-acc4-fdad6799f386',
'isBlocked': False,
'navigation': None,
'redirectCount': 0,
'request': {
'request': '4',
'url': 'https://web-platform.test:8443/webdriver/tests/support/http_handlers/cached.py?status=200&nocache=0.2595580275756214',
'method': 'GET',
'bodySize': 0,
'headersSize': 0,
'headers': [
{
'name': 'Host',
'value': {
'type': 'string',
'value': 'web-platform.test:8443'
}
},
{
'name': 'User-Agent',
'value': {
'type': 'string',
'value': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101 Firefox/129.0'
}
},
{
'name': 'Accept',
'value': {
'type': 'string',
'value': '*/*'
}
},
{
'name': 'Accept-Language',
'value': {
'type': 'string',
'value': 'en-US,en;q=0.5'
}
},
{
'name': 'Accept-Encoding',
'value': {
'type': 'string',
'value': 'gzip, deflate, br, zstd'
}
},
{
'name': 'Referer',
'value': {
'type': 'string',
'value': 'https://web-platform.test:8443/webdriver/tests/bidi/network/support/empty.html'
}
},
{
'name': 'Sec-Fetch-Dest',
'value': {
'type': 'string',
'value': 'empty'
}
},
{
'name': 'Sec-Fetch-Mode',
'value': {
'type': 'string',
'value': 'cors'
}
},
{
'name': 'Sec-Fetch-Site',
'value': {
'type': 'string',
'value': 'same-origin'
}
},
{
'name': 'Connection',
'value': {
'type': 'string',
'value': 'keep-alive'
}
}
],
'cookies': [
],
'timings': {
'timeOrigin': 0,
'requestTime': 1718286785303727,
'redirectStart': 0,
'redirectEnd': 0,
'fetchStart': 1718286785305017,
'dnsStart': 0,
'dnsEnd': 0,
'connectStart': 0,
'connectEnd': 0,
'tlsStart': 0,
'tlsEnd': 0,
'requestStart': 0,
'responseStart': 0,
'responseEnd': 0
}
},
'timestamp': 1718286785315,
'response': {
'url': 'https://web-platform.test:8443/webdriver/tests/support/http_handlers/cached.py?status=200&nocache=0.2595580275756214',
'protocol': 'http/1.1',
'status': 200,
'statusText': 'OK from serviceworker',
'fromCache': True,
'headers': [
{
'name': 'Content-Type',
'value': {
'type': 'string',
'value': 'text/plain;charset=UTF-8'
}
}
],
'mimeType': ';charset=UTF-8',
'bytesReceived': 0,
'headersSize': 0,
'bodySize': 0,
'content': {
'size': 23
}
}
}
As it can be seen we did not request the service worker HTML file, but actually got the OK from serviceworker
as status text for a request of the https://web-platform.test:8443/webdriver/tests/support/http_handlers/cached.py page.
Julian, any idea why this could happen? Not sure how permitting beforeunload or not should have an effect here when even not a beforeunload
prompt is shown. Is that some hick-up with the Network cache?
Comment 6•4 months ago
|
||
As discussed on Matrix, the issue is coming from the service worker test page, which currently uses beforeunload to unregister the serviceworker https://searchfox.org/mozilla-central/rev/4c8627a76e2e0a9b49c2b673424da478e08715ad/testing/web-platform/tests/webdriver/tests/bidi/network/support/serviceworker.html#26-28
We can switch to pagehide or explicitly unregister the SW.
Assignee | ||
Comment 7•4 months ago
|
||
Comment 10•4 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/858f1c8e017c
https://hg.mozilla.org/mozilla-central/rev/29d2b1bc7b4f
Assignee | ||
Updated•2 months ago
|
Description
•