Closed
Bug 1202001
Opened 9 years ago
Closed 9 years ago
Syntax errors in service workers aren't logged to the web console
Categories
(Core :: DOM: Service Workers, defect)
Core
DOM: Service Workers
Tracking
()
RESOLVED
FIXED
mozilla44
People
(Reporter: marco, Assigned: ehsan.akhgari)
References
Details
Attachments
(1 file)
982 bytes,
patch
|
bkelly
:
review+
|
Details | Diff | Splinter Review |
They are logged in the browser console.
Comment 1•9 years ago
|
||
Even with the service workers logging option turned on in the web console?
Reporter | ||
Comment 2•9 years ago
|
||
(In reply to Josh Matthews [:jdm] from comment #1) > Even with the service workers logging option turned on in the web console? Yes. In the fetch event handler, I've added: > console.log("HERE"); > var prova; > prova.asdasd = 4; In the web console I only see the "HERE" message. In the browser console I see the "HERE" message followed by "TypeError: prova is undefined".
Comment 3•9 years ago
|
||
The problem is the service worker never provides a window ID here: https://dxr.mozilla.org/mozilla-central/source/dom/workers/ServiceWorkerPrivate.cpp#339
Blocks: ServiceWorkers-postv1
Assignee | ||
Updated•9 years ago
|
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → ehsan
Assignee | ||
Comment 4•9 years ago
|
||
Attachment #8678612 -
Flags: review?(bkelly)
Comment 5•9 years ago
|
||
Comment on attachment 8678612 [details] [diff] [review] Log errors emitted during service worker lifecycle events to the Web Console Review of attachment 8678612 [details] [diff] [review]: ----------------------------------------------------------------- r=me not to use ID 0 any more. It seems its preferred to use UINT64_MAX for invalid window ID. That being said, I don't think WorkerPrivate::WindowID() will ever return a real window for a service worker. So I don't think this will actually fix the problem described in this bug. Did you see it work for you?
Attachment #8678612 -
Flags: review?(bkelly) → review+
Comment 6•9 years ago
|
||
So, I am adding an nsILogCollector interface in bug 1215140. The purpose is to let us save console messages OMT, and then later log them to the correct window. We could possibly make WorkerPrivate implement this interface and then have SWM log the messages to the window calling .register().
Assignee | ||
Comment 7•9 years ago
|
||
I definitely am seeing an error reported to the web console after this patch on https://ehsan.github.io/sw-versioning/index2.html. That's a simple test case where we register a SW containing a syntax error ("for(;;;;){}").
Comment 9•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/b1095ad5a4b8
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in
before you can comment on or make changes to this bug.
Description
•