Skip to content

Commit b7a64fc

Browse files
committed
[docs] use NW JS binary in workers
1 parent bf3be47 commit b7a64fc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/For Users/Advanced/Protect JavaScript Source Code.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ xhr.onload = () => {
4141
!!! note
4242
The compiled code is executed in [Browser Context](JavaScript Contexts in NW.js.md#browser-context). You can use any Web APIs (such as DOM) and [access NW.js API and Node API](JavaScript Contexts in NW.js.md#access-nodejs-and-nwjs-api-in-browser-context) like other scripts running in browser context.
4343

44+
### Use in Web Workers
45+
46+
A function `importNWBin(ArrayBuffer)` is introduced in worker context. The binary file can be read to array buffer in the main thread, posted to worker and then executed there with the new function.
47+
4448
### Known Issues
4549

4650
Before 0.22, the compiled code runs **slower than normal JS**: ~30% performance according to v8bench. Other non-compiled JS source code will not be affected. In 0.22.0-beta1, this issue has been fixed. Please check our blog post: https://nwjs.io/blog/js-src-protect-perf/

0 commit comments

Comments
 (0)