@@ -62,6 +62,12 @@ function courier(tabId, changed) {
62
62
// a limbo world where both `chrome` and `window` are defined
63
63
// with many unexpected and out of the ordinary behaviors, do
64
64
// 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
65
71
func : ( ) => {
66
72
const source = chrome . runtime . getURL ( '/courier.js' ) ;
67
73
if ( document . querySelector ( `script[src="${ source } "]` ) ) return ;
@@ -72,24 +78,9 @@ function courier(tabId, changed) {
72
78
script . setAttribute ( 'src' , source ) ;
73
79
document . head . appendChild ( script ) ;
74
80
75
- // // TODO: reenable profiler
76
- // if (message.type === 'bridge::ext/profiler' && message.payload) {
77
- // // start profiler
78
- // }
79
-
80
81
chrome . runtime . onMessage . addListener ( ( message , sender ) => {
81
82
if ( sender . id !== chrome . runtime . id ) return ; // unexpected sender
82
83
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
- // }
93
84
} ) ;
94
85
95
86
window . addEventListener ( 'message' , ( { source, data } ) => {
0 commit comments