File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed
components/supervisor/frontend/public Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change 15
15
var originalImportScripts = self . importScripts ;
16
16
// hash contains the original worker URL to be used as a base URI to resolve script URLs
17
17
var baseURI = decodeURI ( location . hash . substr ( 1 ) ) ;
18
- self . importScripts = function ( scriptUrl ) {
19
- return originalImportScripts ( new URL ( scriptUrl , baseURI ) . toString ( ) ) ;
18
+
19
+ self . importScripts = function ( ...scriptUrls ) {
20
+ return originalImportScripts ( ...scriptUrls . map ( scriptUrl => new URL ( scriptUrl , baseURI ) . toString ( ) ) ) ;
21
+ }
22
+
23
+ var originalFetch = self . fetch ;
24
+ self . fetch = function ( input , init ) {
25
+ if ( typeof input === 'string' ) {
26
+ return originalFetch ( new URL ( input , baseURI ) . toString ( ) , init ) ;
27
+ }
28
+ return originalFetch ( input , init ) ;
20
29
}
30
+
31
+ var originalRequest = self . Request ;
32
+ function RequestProxy ( input , init ) {
33
+ if ( typeof input === 'string' ) {
34
+ return new originalRequest ( new URL ( input , baseURI ) . toString ( ) , init ) ;
35
+ }
36
+ return new originalRequest ( input , init ) ;
37
+ }
38
+ RequestProxy . prototype = Object . create ( originalRequest )
39
+ self . Request = RequestProxy ;
40
+
21
41
originalImportScripts ( baseURI ) ;
22
42
} ) ( ) ;
You can’t perform that action at this time.
0 commit comments