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(){ }
<rdar://problem/39945088>
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.