workerboxjs
Advanced tools
Comparing version 2.1.0 to 2.2.0
let workerBoxCount = 0; | ||
function createWorkerBox (scriptUrl) { | ||
function createWorkerBox (scriptUrl, options) { | ||
options = { | ||
appendVersion: true, | ||
randomiseSubdomain: true, | ||
...options, | ||
} | ||
if (scriptUrl.slice(-1) === '/') { | ||
@@ -8,3 +14,6 @@ scriptUrl = scriptUrl.slice(0, -1); | ||
scriptUrl = scriptUrl + '/v2.1.0/'; | ||
if (options.appendVersion) { | ||
scriptUrl = scriptUrl + '/v2.2.0/'; | ||
} | ||
try { | ||
@@ -20,4 +29,6 @@ scriptUrl = new URL(scriptUrl); | ||
const subdomain = [...Array(30)].map(() => Math.random().toString(36)[2]).join(''); | ||
scriptUrl.host = `${subdomain}.${scriptUrl.host}` | ||
if (options.randomiseSubdomain) { | ||
const subdomain = [...Array(30)].map(() => Math.random().toString(36)[2]).join(''); | ||
scriptUrl.host = `${subdomain}.${scriptUrl.host}` | ||
} | ||
@@ -24,0 +35,0 @@ workerBoxCount = workerBoxCount + 1; |
{ | ||
"name": "workerboxjs", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"type": "module", | ||
@@ -8,2 +8,4 @@ "description": "A secure sandbox to execute untrusted user JavaScript, in a web browser, without any risk to your own domain/site/page.", | ||
"scripts": { | ||
"start": "node build.js --watch & servatron --http2 --port 8002 --directory server/dist", | ||
"build": "node build.js", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
@@ -35,4 +37,7 @@ }, | ||
"devDependencies": { | ||
"@markwylde/ftp-deploy": "^1.2.0" | ||
"@markwylde/ftp-deploy": "^1.2.0", | ||
"chokidar": "^3.5.3", | ||
"esbuild": "^0.15.12", | ||
"minify": "^9.1.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4050
62
4