Bug 164678

Summary: Web Inspector: Should be able to display a name for a Worker
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: cdumez, commit-queue, eoconnor, esprehn+autocc, hi, inspector-bugzilla-changes, joepeck, keith_miller, kondapallykalyan, mark.lam, msaboff, rniwa, saam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
See Also: https://bugs.webkit.org/show_bug.cgi?id=172016
https://bugs.webkit.org/show_bug.cgi?id=188779
Bug Depends on: 188779    
Bug Blocks:    
Attachments:
Description Flags
[PATCH] Proposed Fix
none
[IMAGE] Named Workers none

Joseph Pecoraro
Reported 2016-11-11 23:53:19 PST
Summary: Should be able to display a name for a Worker Websites may spawn multiple workers with the same URL but use them for different purposes. It would be nice to name the Worker, such as setting a `name` or `displayName` property on the Worker object from the Page. var worker1 = new Worker("worker.js") worker1.name = "Foo Worker"; var worker2 = new Worker("worker.js"); worker2.name = "Bar Worker"; This could be similar to the `displayName` convention debuggers use with functions. http://www.alertdebugging.com/2009/04/29/building-a-better-javascript-profiler-with-webkit/
Attachments
[PATCH] Proposed Fix (50.92 KB, patch)
2016-11-14 21:48 PST, Joseph Pecoraro
no flags
[IMAGE] Named Workers (165.09 KB, image/png)
2016-11-14 21:49 PST, Joseph Pecoraro
no flags
Radar WebKit Bug Importer
Comment 1 2016-11-11 23:56:02 PST
Joseph Pecoraro
Comment 2 2016-11-14 21:48:40 PST
Created attachment 294810 [details] [PATCH] Proposed Fix This adds a `attribute DOMString name;` to Worker.idl. I'll have to discuss how/if we should go about standardizing this.
Joseph Pecoraro
Comment 3 2016-11-14 21:49:20 PST
Created attachment 294811 [details] [IMAGE] Named Workers Sidebar shows Named and Unnamed workers (defaults to a display name for the URL).
Joseph Pecoraro
Comment 4 2016-11-15 18:49:17 PST
Comment on attachment 294810 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=294810&action=review > Source/WebInspectorUI/UserInterface/Views/WorkerTreeElement.js:175 > + _nameUpdated(event) > + { > + this._updateTitles(); > + } When this happens we need to resort this among its siblings. Also if Thread Line Indicators land this patch would need to be updated to update those.
Joseph Pecoraro
Comment 5 2016-12-09 16:14:08 PST
Going to clear the review on the until we go through some standardization process. I'm also going to break out useful parts of this (Like moving WorkerTarget and MainTarget into their own file) as cleanup now, because I liked it and I've been missing it!
Joseph Pecoraro
Comment 6 2017-05-11 20:24:11 PDT
Looks like this made standardization progress: https://github.com/whatwg/html/issues/2477 https://github.com/whatwg/html/pull/2664#issuecomment-300692176 Solution was a name property on an options dictionary: var worker = new Worker("worker.js", {name: "Foo Worker"}); I think it also sets the `self.name` within the Worker scope. assert( self.name === "Foo Worker" ); So, I should be able to move forward with this.
Devin Rousso
Comment 7 2020-05-04 11:39:00 PDT
*** This bug has been marked as a duplicate of bug 211244 ***
Joseph Pecoraro
Comment 8 2020-05-04 11:43:34 PDT
(In reply to Devin Rousso from comment #7) > > *** This bug has been marked as a duplicate of bug 211244 *** \o/
Note You need to log in before you can comment on or make changes to this bug.