workerboxjs
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -43,3 +43,3 @@ import createCallbackStore from './createCallbackStore.js'; | ||
if (options.appendVersion) { | ||
scriptUrl = scriptUrl + '/v4.0.1/'; | ||
scriptUrl = scriptUrl + '/v4.0.2/'; | ||
} | ||
@@ -46,0 +46,0 @@ |
{ | ||
"name": "workerboxjs", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"type": "module", | ||
@@ -38,3 +38,2 @@ "description": "A secure sandbox to execute untrusted user JavaScript, in a web browser, without any risk to your own domain/site/page.", | ||
"@markwylde/ftp-deploy": "^2.0.1", | ||
"basictap": "^3.4.3", | ||
"chokidar": "^3.5.3", | ||
@@ -45,9 +44,5 @@ "debounce": "^1.2.1", | ||
"minify": "^9.1.0", | ||
"process": "^0.11.10", | ||
"puppeteer": "^19.2.2", | ||
"servatron": "^2.4.2" | ||
}, | ||
"dependencies": { | ||
"promise-deferred": "^2.0.3" | ||
} | ||
} |
@@ -18,2 +18,3 @@ # WorkerBox | ||
// Note each `workerbox` instance has it's own sandbox | ||
const { run, destroy } = await createWorkerBox('https://sandbox.workerbox.net/'); | ||
@@ -26,3 +27,11 @@ | ||
// You can save state between running code | ||
// But this will not save between different workerbox instances. | ||
await run(` | ||
globalThis.sharedVariable = 123 | ||
`); | ||
const result = await run(` | ||
// globalThis.sharedVariable === 123; | ||
async function sayHello (who) { | ||
@@ -37,5 +46,34 @@ return 'Hello ' + who + '. ' + await getMessage(); | ||
destroy() // Destroys the worker box, terminating any running workers | ||
// Destroys the workerbox, terminating the webworker | ||
destroy() | ||
``` | ||
## Development | ||
If you want to check this project out locally, you can do the following: | ||
### Run your own local server | ||
``` | ||
git clone https://github.com/markwylde/workerbox.git | ||
cd workerbox | ||
npm install | ||
npm run start | ||
``` | ||
Visit https://0.0.0.0:8002 in your browser and make sure to ignore the TLS security errors. | ||
Web workers will only work in secure contexts, so we need to do this locally. | ||
### Run the demo project | ||
``` | ||
cd demo | ||
npm install | ||
npm run start | ||
``` | ||
### Run the tests | ||
``` | ||
npm run test | ||
``` | ||
Visit https://0.0.0.0:8000 in your browser. | ||
## How does it work? | ||
@@ -42,0 +80,0 @@ An iframe is inserted into the page from a completely separate domain. |
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
10308
0
8
82
- Removedpromise-deferred@^2.0.3
- Removedasap@2.0.6(transitive)
- Removedpromise@8.3.0(transitive)
- Removedpromise-deferred@2.0.4(transitive)