sourcemap_header_debugger.js (658B)
1 /** 2 * Any copyright is dedicated to the Public Domain. 3 * http://creativecommons.org/publicdomain/zero/1.0/ 4 */ 5 "use strict"; 6 7 addEventListener("message", function (event) { 8 let data; 9 try { 10 data = JSON.parse(event.data); 11 } catch {} 12 13 switch (data.type) { 14 case "request-sourceMapURL": { 15 const dbg = new Debugger(global); 16 const sourceMapURLs = dbg 17 .findSources() 18 .filter(source => source.url === data.url) 19 .map(source => source.sourceMapURL); 20 21 postMessage( 22 JSON.stringify({ 23 type: "response-sourceMapURL", 24 value: sourceMapURLs, 25 }) 26 ); 27 break; 28 } 29 } 30 });