You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/For Users/Advanced/JavaScript Contexts in NW.js.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ Different windows and frames have different contexts. So when you create a new f
46
46
47
47
Some objects of Node context are copied to Browser context so that scripts running in Browser context can access Node.js objects:
48
48
49
-
*`nw` -- the object of all [NW.js APIs](../../References)
49
+
*`nw` -- the object of all NW.js APIs in **`References`** section
50
50
*`global` -- the global object of Node Context; same as `nw.global`
51
51
*`require` -- the `require()` function for loading Node.js modules; similar to `nw.require()`, but it also supports `require('nw.gui')` to load NW.js API module.
52
52
*`process` -- the [process module](https://nodejs.org/api/globals.html#globals_process) of Node.js; same as `nw.process`
@@ -74,7 +74,7 @@ Scripts running in the Node context can use [JS builtin objects]() like browse
74
74
**All node modules shares a same Node context in separate context mode**. But you have several ways to create new Node contexts:
75
75
76
76
* Set `new_instance` option to `true` when creating window with [`Window.open()`](../../References/Window.md#windowopenurl-options-callback)
77
-
* Start NW.js with `--mixed-context` CLI option to turn NW.js into [Mixed Context mode](#mixed-context)
77
+
* Start NW.js with `--mixed-context` CLI option to turn NW.js into [Mixed Context mode](#mixed-context-mode)
78
78
79
79
#### Access Browser and NW.js API in Node Context
80
80
@@ -96,7 +96,7 @@ In the browser side (index.html):
96
96
<script>
97
97
var myscript =require('./myscript');
98
98
// pass the `el` element to the Node function
99
-
myscript.setText(document.getElementbyId('el'));
99
+
myscript.setText(document.getElementById('el'));
100
100
// you will see "hello" in the element
101
101
</script>
102
102
```
@@ -110,7 +110,7 @@ Relative paths in node modules are resolved according to path of that module (li
110
110
111
111
## Mixed Context Mode
112
112
113
-
Mixed context is introduced in NW.js 0.13. When running NW.js with [`--mixed-context` CLI option](../../References/Command Line Options.md#mixedcontext), a new Node context is created at the time of each browser context creation and running in a same context as browser context, a.k.a. the Mixed context.
113
+
Mixed context is introduced in NW.js 0.13. When running NW.js with [`--mixed-context` CLI option](../../References/Command Line Options.md#-mixed-context), a new Node context is created at the time of each browser context creation and running in a same context as browser context, a.k.a. the Mixed context.
Copy file name to clipboardExpand all lines: docs/References/Window.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -126,7 +126,7 @@ Get or set the page zoom. `0` for normal size; positive value for zooming in; ne
126
126
127
127
## win.cookies.*
128
128
129
-
This includes multiple functions to manipulate the cookies. The API is defined in the same way as [Chrome Extensions'](http://developer.chrome.com/extensions/cookies.html). NW.js supports the `get`, `getAll`, `remove` and `set` methods; `onChanged` event (supporting both `addListener` and `removeListener` function on this event).
129
+
This includes multiple functions to manipulate the cookies. The API is defined in the same way as [Chrome Extensions](http://developer.chrome.com/extensions/cookies.html). NW.js supports the `get`, `getAll`, `remove` and `set` methods; `onChanged` event (supporting both `addListener` and `removeListener` function on this event).
130
130
131
131
And anything related to `CookieStore` in the Chrome extension API is not supported, because there is only one global cookie store in NW.js apps.
132
132
@@ -571,7 +571,7 @@ Emitted when window leaves fullscreen state.
571
571
572
572
## Event: zoom
573
573
574
-
Emitted when window zooming changed. It has a parameter indicating the new zoom level. See [`win.zoom()` method](#winzoom) for the parameter's value definition.
574
+
Emitted when window zooming changed. It has a parameter indicating the new zoom level. See [`win.zoom()` method](#winzoomlevel) for the parameter's value definition.
0 commit comments