Closed Bug 1634691 Opened 4 years ago Closed 4 years ago

Return early in Page.navigate for all non-http traffic

Categories

(Remote Protocol :: CDP, defect, P1)

defect

Tracking

(firefox78 fixed)

RESOLVED FIXED
Firefox 78
Tracking Status
firefox78 --- fixed

People

(Reporter: impossibus, Assigned: impossibus)

References

Details

(Whiteboard: [puppeteer-beta-reserve])

Attachments

(2 files)

It already returns early for data: and about: schemes, so this just expands the condition.

Otherwise the command times out because the current implementation is waiting for events that don't occur in these cases.

This at least makes the command usable for file:// etc while follow-up bugs get fixed (such as Bug 1634690)

While writing a test for file urls, I saw RemoteAgent.close() hit an error in test teardown because a destructor was unable to look up the id of a target to clean up. For some reason, that target did not have a browsing context id. (Perhaps it wasn't fully initialized after file:// navigation?)

https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=300284517&repo=try&lineNumber=4798

Excerpt:

RemoteAgent	ERROR	unable to stop listener: TypeError: can't access property "id", this.browsingContext is null(chrome://remote/content/targets/TabTarget.jsm:55:5) JS Stack trace: get id@TabTarget.jsm:55:5
destroyTarget@TargetList.jsm:104:5
destructor@TargetList.jsm:114:12
close@RemoteAgent.jsm:115:22
fn@head.js:90:25
Async*Tester_execTest/<@browser-test.js:1039:34
async*Tester_execTest@browser-test.js:1074:11
nextTest/<@browser-test.js:904:14
SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<@SimpleTest.js:918:23
!!! could not start server on port 9222: [Exception... "Component returned failure code: 0x804b0036 (NS_ERROR_SOCKET_ADDRESS_IN_USE) [nsIServerSocket.init]"  nsresult: "0x804b0036 (NS_ERROR_SOCKET_ADDRESS_IN_USE)"  location: "JS frame :: chrome://remote/content/server/HTTPD.jsm :: _start :: line 567"  data: no]
1588278702525	RemoteAgent	ERROR	unable to stop listener: [Exception... "Unexpected error"  nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)"  location: "JS frame :: chrome://remote/content/server/HTTPD.jsm :: stop :: line 621"  data: no] Stack trace: stop()@HTTPD.jsm:621
close()@RemoteAgent.jsm:119
asyncListen()@RemoteAgent.jsm:100

This fixes exceptions hit in destructors when the browsing context
is null.

Assignee: nobody → mjzffr
Status: NEW → ASSIGNED
Whiteboard: [puppeteer-beta-reserve]
Pushed by mjzffr@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/6253f484818a
Decouple Target id from browsing context id r=remote-protocol-reviewers,whimboo
https://hg.mozilla.org/integration/autoland/rev/c3478c000960
Return early in Page.navigate for all non-http traffic r=remote-protocol-reviewers,whimboo
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 78
Priority: -- → P1
Component: CDP: Page → CDP
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: