@fails-components/jupyter-launcher 0.0.1-alpha.12 → 0.0.1-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +0 -28
- package/package.json +1 -1
- package/src/index.ts +0 -28
package/lib/index.js
CHANGED
|
@@ -80,20 +80,6 @@ const installFetchPatches = ({ allowedSites = undefined, proxySites = undefined,
|
|
|
80
80
|
headers: { 'Content-Type': 'text/plain' }
|
|
81
81
|
});
|
|
82
82
|
};
|
|
83
|
-
const oldImportScripts = globalThis.importScripts;
|
|
84
|
-
globalThis.importScripts = (...args) => {
|
|
85
|
-
const newargs = args.map(url => {
|
|
86
|
-
const urlObj = new URL(url, location.href);
|
|
87
|
-
if (allowedOrigins.includes(urlObj.origin)) {
|
|
88
|
-
return url;
|
|
89
|
-
}
|
|
90
|
-
if (proxySites && proxySites.includes(urlObj.origin)) {
|
|
91
|
-
return proxyURL + urlObj.hostname + urlObj.pathname;
|
|
92
|
-
}
|
|
93
|
-
throw new Error('Script is from blocked URL');
|
|
94
|
-
});
|
|
95
|
-
return oldImportScripts(...newargs);
|
|
96
|
-
};
|
|
97
83
|
const oldWorker = Worker;
|
|
98
84
|
const NewWorker = function (script, options) {
|
|
99
85
|
const scriptURL = script instanceof URL ? script : new URL(script, location.href);
|
|
@@ -146,20 +132,6 @@ const installFetchPatches = ({ allowedSites = undefined, proxySites = undefined,
|
|
|
146
132
|
headers: { 'Content-Type': 'text/plain' }
|
|
147
133
|
});
|
|
148
134
|
};
|
|
149
|
-
const oldImportScripts = globalThis.importScripts;
|
|
150
|
-
globalThis.importScripts = (...args) => {
|
|
151
|
-
const newargs = args.map(url => {
|
|
152
|
-
const urlObj = new URL(url, location.href);
|
|
153
|
-
if (allowedOrigins.includes(urlObj.origin)) {
|
|
154
|
-
return url;
|
|
155
|
-
}
|
|
156
|
-
if (proxySites && proxySites.includes(urlObj.origin)) {
|
|
157
|
-
return proxyURL + urlObj.hostname + urlObj.pathname;
|
|
158
|
-
}
|
|
159
|
-
throw new Error('Script is from blocked URL');
|
|
160
|
-
});
|
|
161
|
-
return oldImportScripts(...newargs);
|
|
162
|
-
};
|
|
163
135
|
Object.defineProperty(globalThis, 'location', {
|
|
164
136
|
value: new URL('${scriptURL.href}'),
|
|
165
137
|
writable: false,
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -283,20 +283,6 @@ const installFetchPatches = ({
|
|
|
283
283
|
headers: { 'Content-Type': 'text/plain' }
|
|
284
284
|
});
|
|
285
285
|
};
|
|
286
|
-
const oldImportScripts = globalThis.importScripts;
|
|
287
|
-
globalThis.importScripts = (...args) => {
|
|
288
|
-
const newargs = args.map(url => {
|
|
289
|
-
const urlObj = new URL(url, location.href);
|
|
290
|
-
if (allowedOrigins.includes(urlObj.origin)) {
|
|
291
|
-
return url;
|
|
292
|
-
}
|
|
293
|
-
if (proxySites && proxySites.includes(urlObj.origin)) {
|
|
294
|
-
return proxyURL + urlObj.hostname + urlObj.pathname;
|
|
295
|
-
}
|
|
296
|
-
throw new Error('Script is from blocked URL');
|
|
297
|
-
});
|
|
298
|
-
return oldImportScripts(...newargs);
|
|
299
|
-
};
|
|
300
286
|
const oldWorker = Worker;
|
|
301
287
|
const NewWorker = function (
|
|
302
288
|
script: string | URL,
|
|
@@ -353,20 +339,6 @@ const installFetchPatches = ({
|
|
|
353
339
|
headers: { 'Content-Type': 'text/plain' }
|
|
354
340
|
});
|
|
355
341
|
};
|
|
356
|
-
const oldImportScripts = globalThis.importScripts;
|
|
357
|
-
globalThis.importScripts = (...args) => {
|
|
358
|
-
const newargs = args.map(url => {
|
|
359
|
-
const urlObj = new URL(url, location.href);
|
|
360
|
-
if (allowedOrigins.includes(urlObj.origin)) {
|
|
361
|
-
return url;
|
|
362
|
-
}
|
|
363
|
-
if (proxySites && proxySites.includes(urlObj.origin)) {
|
|
364
|
-
return proxyURL + urlObj.hostname + urlObj.pathname;
|
|
365
|
-
}
|
|
366
|
-
throw new Error('Script is from blocked URL');
|
|
367
|
-
});
|
|
368
|
-
return oldImportScripts(...newargs);
|
|
369
|
-
};
|
|
370
342
|
Object.defineProperty(globalThis, 'location', {
|
|
371
343
|
value: new URL('${scriptURL.href}'),
|
|
372
344
|
writable: false,
|