ASSIGNED 185258
Web Inspector: Scripts imported by both main page and web worker are duplicated in debugger sources
https://bugs.webkit.org/show_bug.cgi?id=185258
Summary Web Inspector: Scripts imported by both main page and web worker are duplicat...
Owen Shaw
Reported 2018-05-03 10:09:19 PDT
Created attachment 339422 [details] Screenshot of duplicate debugger sources Duplicate entries are shown in the debugger sources list when the same script is imported by both the HTML page and a web worker created by the page. For example: 1. bug.html includes lib.js via a script tag 2. bug.html starts a new worker via new Worker('worker.js') 3. worker.js also imports lib.js via importScripts('lib.js') lib.js will appear twice in the debugger sources list. See attached screenshot. The two entries seem to behave as if they are one (e.g., add a breakpoint to one of the duplicate entries, and that breakpoint will be there in the other duplicate). Expected: A script should only show up once in the debugger sources list. Chrome and Firefox inspectors basically have separate lists for each page/worker, so no list has two entries for the same script. Safari 11.1 and Safari Technology Preview Release 55 bug.html -------- <!DOCTYPE html> <html> <head> <script type="text/javascript" src="lib.js"></script> <script type="text/javascript"> var worker = new Worker('./worker.js'); </script> </head> <body> </body> </html> worker.js ---------- importScripts('lib.js'); lib.js ------ function test(){ }
Attachments
Screenshot of duplicate debugger sources (24.75 KB, image/png)
2018-05-03 10:09 PDT, Owen Shaw
no flags
Radar WebKit Bug Importer
Comment 1 2018-05-03 10:19:01 PDT
Blaze Burg
Comment 2 2018-05-07 11:53:30 PDT
This is as expected given the current design. We show one script for each copy that's evaluated into a VM. Breakpoints are file and line number based, and don't take into account the specific instance/content view of the script. I agree we could improve the categorization of scripts as belonging to a SW, worker, main page, etc.
Note You need to log in before you can comment on or make changes to this bug.