File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,8 @@ function getRootDomain(url: URL): string {
132132 return tldts . getDomain ( url . href ) || url . hostname ;
133133}
134134
135+ const virtualInjectUrl = "/inject.js" ;
136+
135137function makeController ( url : URL ) : Controller {
136138 let originurl = new URL ( ISOLATION_ORIGIN ) ;
137139 let baseurl = new URL (
@@ -175,7 +177,11 @@ function makeController(url: URL): Controller {
175177 const head = findhead ( handler . root as Node as Element ) ! ;
176178
177179 // inject after the scramjet scripts and before the rest of the page
178- head . children . splice ( 3 , 0 , new Element ( "script" , { src : injectScript } ) ) ;
180+ head . children . splice (
181+ 3 ,
182+ 0 ,
183+ new Element ( "script" , { src : virtualInjectUrl } )
184+ ) ;
179185 } ) ;
180186
181187 const controller = {
@@ -240,7 +246,7 @@ const methods = {
240246 return [ await makeWasmResponse ( ) , undefined ] ;
241247 } else if ( data . rawUrl . pathname === cfg . files . all ) {
242248 return [ await makeAllResponse ( ) , undefined ] ;
243- } else if ( data . rawUrl . pathname === "/inject.js" ) {
249+ } else if ( data . rawUrl . pathname === virtualInjectUrl ) {
244250 return [
245251 await fetch ( injectScript ) . then ( async ( x ) => {
246252 const text = await x . text ( ) ;
You can’t perform that action at this time.
0 commit comments