@@ -62,6 +62,12 @@ function courier(tabId, changed) {
6262 // a limbo world where both `chrome` and `window` are defined
6363 // with many unexpected and out of the ordinary behaviors, do
6464 // minimal work here and delegate to `courier.js` in the page.
65+ // only a subset of APIs are available in this `chrome` limbo
66+ // - chrome.csi->f()
67+ // - chrome.dom.{openOrClosedShadowRoot->f()}
68+ // - chrome.extension.{ViewType, inIncognitoContext}
69+ // - chrome.i18n
70+ // - chrome.runtime
6571 func : ( ) => {
6672 const source = chrome . runtime . getURL ( '/courier.js' ) ;
6773 if ( document . querySelector ( `script[src="${ source } "]` ) ) return ;
@@ -72,24 +78,9 @@ function courier(tabId, changed) {
7278 script . setAttribute ( 'src' , source ) ;
7379 document . head . appendChild ( script ) ;
7480
75- // // TODO: reenable profiler
76- // if (message.type === 'bridge::ext/profiler' && message.payload) {
77- // // start profiler
78- // }
79-
8081 chrome . runtime . onMessage . addListener ( ( message , sender ) => {
8182 if ( sender . id !== chrome . runtime . id ) return ; // unexpected sender
8283 window . postMessage ( message ) ; // relay to content script (courier.js)
83-
84- // switch (message.type) {
85- // case 'startProfiler':
86- // window.sessionStorage.SvelteDevToolsProfilerEnabled = 'true';
87- // break;
88- // case 'stopProfiler':
89- // case 'bridge::ext/clear':
90- // delete window.sessionStorage.SvelteDevToolsProfilerEnabled;
91- // break;
92- // }
9384 } ) ;
9485
9586 window . addEventListener ( 'message' , ( { source, data } ) => {
0 commit comments