Closed
Bug 1212718
Opened 8 years ago
Closed 8 years ago
chrome.webRequest.onCompleted never fires
Categories
(WebExtensions :: Untriaged, defect)
WebExtensions
Untriaged
Tracking
(firefox44 fixed)
RESOLVED
FIXED
mozilla44
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: ma1, Assigned: billm)
References
(Blocks 1 open bug)
Details
(Whiteboard: [webRequest])
Attachments
(4 files)
74.98 KB,
application/x-xpinstall
|
Details | |
4.87 KB,
patch
|
mossop
:
review+
|
Details | Diff | Splinter Review |
3.69 KB,
patch
|
mossop
:
review+
|
Details | Diff | Splinter Review |
6.68 KB,
patch
|
mossop
:
review+
|
Details | Diff | Splinter Review |
See the attached sample XPI. Furthermore, we should either implement onErrorOccurred or at least call onCompleted also when the request is aborted by an error (you can use a global nsIWebProgressListener to track that).
Updated•8 years ago
|
Whiteboard: [webRequest]
Reporter | ||
Comment 1•8 years ago
|
||
OK, I've figured out what's going on. At the time when onStopRequest is called on our channel listener, causing "onStop" and eventually "onCompleted" to be fired, HttpObserverManager.getLoadContext(channel) returns null, and therefore the "browser" variable is set to null: http://mxr.mozilla.org/mozilla-central/source/toolkit/modules/addons/WebRequest.jsm#250 This causes the wrapper of the "onCompleted" event callback to return prematurely because the tab id could not be retrieved: http://mxr.mozilla.org/mozilla-central/source/toolkit/components/extensions/ext-webRequest.js#24 We need either to retrieve this info in some other way or to omit it from onCompleted's details. Any ETA for a fix? I've got a demo in 2 days (which does not depend on the tab id being available in onCompleted, BTW) and this would really help.
Flags: needinfo?(wmccloskey)
Flags: needinfo?(amckay)
Reporter | ||
Comment 2•8 years ago
|
||
On a side note, outerWindowId is available at that time, so in the worst case (when browser is unavailable) we could always return tabId as a lazy property to be initialized on demand by iterating across the available browsers until we match the outer window id (maybe starting with the focused one as a tentative optimization).
Assignee | ||
Comment 3•8 years ago
|
||
The problem here, as Giorgio pointed out, is that the load context is null when we get the onStopRequest notification in e10s (in non-e10s it's still valid). That's presumably some leak prevention thing we do (none of the networking code is cycle collected). This patch just keeps the load context alive by saving it in the StartStopListener. I was a bit concerned about leaks here, but the networking code seems to null out the listener for us later.
Flags: needinfo?(wmccloskey)
Flags: needinfo?(amckay)
Attachment #8672844 -
Flags: review?(dtownsend)
Assignee | ||
Comment 4•8 years ago
|
||
Oh, this patch also fixes an unrelated bug I noticed where runChannelListener doesn't return true at the end (signalling that the load wasn't blocked).
Assignee | ||
Comment 5•8 years ago
|
||
This patch adds a test for the issue where we weren't returning true. The bug manifests in us not calling runChannelListener("afterModify") in some cases, which leads to onSendHeaders not firing.
Attachment #8672845 -
Flags: review?(dtownsend)
Assignee | ||
Comment 6•8 years ago
|
||
Here's a test for the onCompleted issue. I had to refactor the test a bit.
Updated•8 years ago
|
Attachment #8672844 -
Flags: review?(dtownsend) → review+
Updated•8 years ago
|
Attachment #8672845 -
Flags: review?(dtownsend) → review+
Updated•8 years ago
|
Attachment #8672846 -
Flags: review?(dtownsend) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/d010e8c17cf3 https://hg.mozilla.org/integration/mozilla-inbound/rev/db2151d8093a https://hg.mozilla.org/integration/mozilla-inbound/rev/88b05cd86727 https://hg.mozilla.org/integration/mozilla-inbound/rev/bb924113e8c6 https://hg.mozilla.org/integration/mozilla-inbound/rev/09f71d26b0e3
Assignee | ||
Comment 8•8 years ago
|
||
Last two commits were actually for bug 1209983.
Comment 9•8 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/d010e8c17cf3 https://hg.mozilla.org/mozilla-central/rev/db2151d8093a https://hg.mozilla.org/mozilla-central/rev/88b05cd86727 https://hg.mozilla.org/mozilla-central/rev/bb924113e8c6 https://hg.mozilla.org/mozilla-central/rev/09f71d26b0e3
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
Reporter | ||
Updated•8 years ago
|
Blocks: webext-port-noscript
Updated•6 years ago
|
Product: Toolkit → WebExtensions
You need to log in
before you can comment on or make changes to this bug.
Description
•