Skip to content

Commit 9d42a34

Browse files
committed
Merge remote-tracking branch 'upstream/master' into screencap
2 parents f781924 + 757cfcb commit 9d42a34

32 files changed

+283
-71
lines changed

AUTHORS

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,6 @@ Cong Liu <leehom2001@gmail.com>
3333
Eric Newport <kethinov@gmail.com>
3434
Marco Fabbri <mrfabbri@gmail.com>
3535
Daniel Braun <danielbraun@me.com>
36-
Chase Willden <chase.willden@gmail.com>
36+
Chase Willden <chase.willden@gmail.com>
37+
Anton Khlynovskiy <subzey@gmail.com>
38+
Wu Yuehang <yuehan9.wu@gmail.com>

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
0.12.2 / 05-22-2015
2+
===================
3+
- Fix #2723: [OSX] cpu hog in some cases
4+
- Fix #3361: application cache
5+
- Fix #2720: [Linux] launching sudo hits error: effective uid is not 0
6+
- Fix #2819: enable cookie support for web sockets
7+
- Fix #2713: crash with 'new-win-policy' and opening window from iframe
8+
- Fix #3123: support no-displaying-insecure-content and allow-running-insecure-content
9+
- [Screen Selection] add application name to the UI; cancelChooseDesktopMedia implementation
10+
- [Notification] [WIN] disable audio for toast notification, better fallback for toast notification
11+
- Change cache backend from "simple" to "blockfile"
12+
13+
0.12.1 / 04-13-2015
14+
===================
15+
- Fix crash dump generation
16+
- [WIN] Fix blurry text with High DPI display
17+
- Fix: Webview : contentWindow not available at this time (#3126)
18+
- More precise RegExp for App.argv filtering (Thanks to Anton Khlynovskiy)
19+
- Fix #3143: remote debugging devtools page blank (Thanks to Yuehang Wu)
20+
- [Notification][Win] fix for missing windows events
21+
- add Window 'progress' event (Thanks to vadim-kudr <x.kydrik.x@gmail.com>)
22+
- nw-headers is built automatically now in buildbot (Thanks to Xue Yang)
23+
124
0.12.0 / 03-05-2015
225
=======================
326
- Chromium updated to 41.0.2272.76

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,16 @@ It was created in the Intel Open Source Technology Center.
2626
* Available on Linux, Mac OS X and Windows
2727

2828
## Downloads
29-
* **v0.12.0:** (Mar 5, 2015, based off of IO.js v1.2.0, Chromium 41.0.2272.76): [release notes](https://groups.google.com/d/msg/nwjs-general/NJA-Up4MFug/1jmBPjzklSUJ)
30-
* Linux: [32bit](http://dl.nwjs.io/v0.12.0/nwjs-v0.12.0-linux-ia32.tar.gz) / [64bit](http://dl.nwjs.io/v0.12.0/nwjs-v0.12.0-linux-x64.tar.gz)
31-
* Windows: [32bit](http://dl.nwjs.io/v0.12.0/nwjs-v0.12.0-win-ia32.zip) / [64bit](http://dl.nwjs.io/v0.12.0/nwjs-v0.12.0-win-x64.zip)
32-
* Mac 10.7+: [32bit](http://dl.nwjs.io/v0.12.0/nwjs-v0.12.0-osx-ia32.zip) / [64bit](http://dl.nwjs.io/v0.12.0/nwjs-v0.12.0-osx-x64.zip)
29+
* **v0.12.2:** (May 22, 2015, based off of IO.js v1.2.0, Chromium 41.0.2272.76): [release notes](https://groups.google.com/d/msg/nwjs-general/Xbq64dUKZsk/_pTwW7hgAfkJ)
30+
* Linux: [32bit](http://dl.nwjs.io/v0.12.2/nwjs-v0.12.2-linux-ia32.tar.gz) / [64bit](http://dl.nwjs.io/v0.12.2/nwjs-v0.12.2-linux-x64.tar.gz)
31+
* Windows: [32bit](http://dl.nwjs.io/v0.12.2/nwjs-v0.12.2-win-ia32.zip) / [64bit](http://dl.nwjs.io/v0.12.2/nwjs-v0.12.2-win-x64.zip)
32+
* Mac 10.7+: [32bit](http://dl.nwjs.io/v0.12.2/nwjs-v0.12.2-osx-ia32.zip) / [64bit](http://dl.nwjs.io/v0.12.2/nwjs-v0.12.2-osx-x64.zip)
33+
34+
* **v0.13.0-alpha0:** (May 10, 2015, based off of IO.js v1.5.1, Chromium 43.0.2357.45): [release notes](https://groups.google.com/d/msg/nwjs-general/IqfH1RXNGlw/2PgeRGHO-B4J)
35+
**NOTE** You might want the **SDK build**. Please read the [release notes](https://groups.google.com/d/msg/nwjs-general/IqfH1RXNGlw/2PgeRGHO-B4J)
36+
* Linux: [32bit](http://dl.nwjs.io/v0.13.0/alpha0/nwjs-v0.13.0-alpha0-linux-ia32.tar.gz) / [64bit](http://dl.nwjs.io/v0.13.0/alpha0/nwjs-v0.13.0-alpha0-linux-x64.tar.gz)
37+
* Windows: [32bit](http://dl.nwjs.io/v0.13.0/alpha0/nwjs-v0.13.0-alpha0-win-ia32.zip) / [64bit](http://dl.nwjs.io/v0.13.0/alpha0/nwjs-v0.13.0-alpha0-win-x64.zip)
38+
* Mac 10.7+: [32bit](http://dl.nwjs.io/v0.13.0/alpha0/nwjs-v0.13.0-alpha0-osx-ia32.zip) / [64bit](http://dl.nwjs.io/v0.13.0/alpha0/nwjs-v0.13.0-alpha0-osx-x64.zip)
3339

3440
* **0.8.6:** (Apr 18, 2014, based off of Node v0.10.22, Chrome 30.0.1599.66) **If your native Node module works only with Node v0.10, then you should use node-webkit v0.8.x, which is also a maintained branch. [More info](https://groups.google.com/d/msg/nwjs-general/2OJ1cEMPLlA/09BvpTagSA0J)**
3541
[release notes](https://groups.google.com/d/msg/nwjs-general/CLPkgfV-i7s/hwkkQuJ1kngJ)
@@ -38,7 +44,7 @@ It was created in the Intel Open Source Technology Center.
3844
* Windows: [win32](http://dl.node-webkit.org/v0.8.6/node-webkit-v0.8.6-win-ia32.zip)
3945
* Mac: [32bit, 10.7+](http://dl.node-webkit.org/v0.8.6/node-webkit-v0.8.6-osx-ia32.zip)
4046

41-
* **latest live build**: git tip version; build triggered from every git commit: http://dl.node-webkit.org/live-build/
47+
* **latest live build**: git tip version; build triggered from every git commit: http://dl.nwjs.io/live-build/
4248

4349
* [Previous versions](https://github.com/rogerwang/node-webkit/wiki/Downloads-of-old-versions)
4450

@@ -67,6 +73,7 @@ Create `package.json`:
6773
```json
6874
{
6975
"name": "nw-demo",
76+
"version": "0.0.1",
7077
"main": "index.html"
7178
}
7279
```
@@ -78,10 +85,9 @@ $ /path/to/nw . (suppose the current directory contains 'package.json')
7885

7986
Note: on Windows, you can drag the folder containing `package.json` to `nw.exe` to open it.
8087

81-
Note: on OSX, the executable binary is in a hidden directory within the .app file. To run node-webkit on OSX, type:
82-
```bash
83-
$ /path/to/node-webkit.app/Contents/MacOS/node-webkit . (suppose the current directory contains 'package.json')
84-
```
88+
Note: on OSX, the executable binary is in a hidden directory within the .app file. To run node-webkit on OSX, type:
89+
`/path/to/nwjs.app/Contents/MacOS/nwjs .` *(suppose the current directory contains 'package.json')*
90+
8591
## Documents
8692

8793
For more information on how to write/package/run apps, see:

src/api/app/app.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ function App() {
2626
require('util').inherits(App, exports.Base);
2727

2828
App.filteredArgv = [
29-
/--no-toolbar/,
30-
/--url=.*/,
31-
/--remote-debugging-port=.*/,
32-
/--renderer-cmd-prefix.*/,
29+
/^--no-toolbar$/,
30+
/^--url=/,
31+
/^--remote-debugging-port=/,
32+
/^--renderer-cmd-prefix/,
3333
];
3434

3535
App.prototype.quit = function() {

src/api/clipboard/clipboard.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Clipboard.prototype.set = function(data, type) {
3030
type = 'text';
3131

3232
if (type != 'text')
33-
throw new String("Type of '" + type + "' is not supported");
33+
throw new TypeError("Type of '" + type + "' is not supported");
3434

3535
nw.callObjectMethod(this, 'Set', [ data, type ]);
3636
}
@@ -40,7 +40,7 @@ Clipboard.prototype.get = function(type) {
4040
type = 'text';
4141

4242
if (type != 'text')
43-
throw new String('Only support getting plain text from Clipboard');
43+
throw new TypeError('Only support getting plain text from Clipboard');
4444

4545
var result = nw.callObjectMethodSync(this, 'Get', [ type ]);
4646
if (type == 'text')

src/api/dispatcher.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,10 @@ void Dispatcher::willHandleNavigationPolicy(
217217
v8::HandleScope handleScope(isolate);
218218

219219
v8::Handle<v8::Value> id_val;
220-
if (web_view->mainFrame() && !web_view->mainFrame()->mainWorldScriptContext().IsEmpty())
220+
if (web_view->mainFrame() && !web_view->mainFrame()->mainWorldScriptContext().IsEmpty()) {
221+
v8::Context::Scope cscope (web_view->mainFrame()->mainWorldScriptContext());
221222
id_val = nwapi::Dispatcher::GetWindowId(web_view->mainFrame());
223+
}
222224
if (id_val.IsEmpty())
223225
return;
224226
if (id_val->IsUndefined() || id_val->IsNull())

src/api/menu/menu.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function Menu(option) {
2727
option = { type: 'contextmenu' };
2828

2929
if (option.type != 'contextmenu' && option.type != 'menubar')
30-
throw new String('Invalid menu type: ' + option.type);
30+
throw new TypeError('Invalid menu type: ' + option.type);
3131

3232
this.type = option.type;
3333
v8_util.setHiddenValue(this, 'items', []);
@@ -40,12 +40,12 @@ Menu.prototype.__defineGetter__('items', function() {
4040
});
4141

4242
Menu.prototype.__defineSetter__('items', function(val) {
43-
throw new String('Menu.items is immutable');
43+
throw new Error('Menu.items is immutable');
4444
});
4545

4646
Menu.prototype.append = function(menu_item) {
4747
if (v8_util.getConstructorName(menu_item) != 'MenuItem')
48-
throw new String("Menu.append() requires a valid MenuItem");
48+
throw new TypeError("Menu.append() requires a valid MenuItem");
4949

5050
this.items.push(menu_item);
5151
nw.callObjectMethod(this, 'Append', [ menu_item.id ]);

src/api/menuitem/menuitem.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,22 @@ var v8_util = process.binding('v8_util');
2222

2323
function MenuItem(option) {
2424
if (typeof option != 'object')
25-
throw new String('Invalid option.');
25+
throw new TypeError('Invalid option.');
2626

2727
if (!option.hasOwnProperty('type'))
2828
option.type = 'normal';
2929

3030
if (option.type != 'normal' &&
3131
option.type != 'checkbox' &&
3232
option.type != 'separator')
33-
throw new String('Invalid MenuItem type: ' + option.type);
33+
throw new TypeError('Invalid MenuItem type: ' + option.type);
3434

3535
if (option.type == 'normal' || option.type == 'checkbox') {
3636
if (option.type == 'checkbox')
3737
option.checked = Boolean(option.checked);
3838

3939
if (!option.hasOwnProperty('label'))
40-
throw new String('A normal MenuItem must have a label');
40+
throw new TypeError('A normal MenuItem must have a label');
4141
else
4242
option.label = String(option.label);
4343

@@ -59,7 +59,7 @@ function MenuItem(option) {
5959

6060
if (option.hasOwnProperty('submenu')) {
6161
if (v8_util.getConstructorName(option.submenu) != 'Menu')
62-
throw new String("'submenu' must be a valid Menu");
62+
throw new TypeError("'submenu' must be a valid Menu");
6363

6464
// Transfer only object id
6565
v8_util.setHiddenValue(this, 'submenu', option.submenu);
@@ -68,7 +68,7 @@ function MenuItem(option) {
6868

6969
if (option.hasOwnProperty('click')) {
7070
if (typeof option.click != 'function')
71-
throw new String("'click' must be a valid Function");
71+
throw new TypeError("'click' must be a valid Function");
7272
else
7373
this.click = option.click;
7474
}
@@ -100,7 +100,7 @@ MenuItem.prototype.__defineGetter__('type', function() {
100100
});
101101

102102
MenuItem.prototype.__defineSetter__('type', function() {
103-
throw new String("'type' is immutable at runtime");
103+
throw new Error("'type' is immutable at runtime");
104104
});
105105

106106
MenuItem.prototype.__defineGetter__('label', function() {
@@ -162,7 +162,7 @@ MenuItem.prototype.__defineGetter__('checked', function() {
162162

163163
MenuItem.prototype.__defineSetter__('checked', function(val) {
164164
if (this.type != 'checkbox')
165-
throw new String("'checked' property is only available for checkbox");
165+
throw new TypeError("'checked' property is only available for checkbox");
166166

167167
this.handleSetter('checked', 'SetChecked', Boolean, val);
168168
});
@@ -181,7 +181,7 @@ MenuItem.prototype.__defineGetter__('submenu', function() {
181181

182182
MenuItem.prototype.__defineSetter__('submenu', function(val) {
183183
if (v8_util.getConstructorName(val) != 'Menu')
184-
throw new String("'submenu' property requries a valid Menu");
184+
throw new TypeError("'submenu' property requries a valid Menu");
185185

186186
v8_util.setHiddenValue(this, 'submenu', val);
187187
nw.callObjectMethod(this, 'SetSubmenu', [ val.id ]);

src/api/screen/desktop_capture_api.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#include "content/public/browser/render_process_host.h"
1313
#include "content/public/browser/render_view_host.h"
1414
#include "content/public/browser/web_contents.h"
15+
#include "content/nw/src/nw_package.h"
16+
#include "content/nw/src/nw_shell.h"
1517
#include "net/base/net_util.h"
1618
#include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h"
1719
#include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
@@ -68,7 +70,8 @@ bool DesktopCaptureChooseDesktopMediaFunction::RunSync() {
6870
// also be used to determine where to show the picker's UI.
6971
content::WebContents* web_contents = content::WebContents::FromRenderViewHost(render_view_host());
7072
DCHECK(web_contents);
71-
base::string16 target_name;
73+
content::Shell* shell = content::Shell::windows()[0];
74+
base::string16 app_name = base::UTF8ToUTF16(shell->GetPackage()->GetName());
7275

7376
// Register to be notified when the tab is closed.
7477
Observe(web_contents);
@@ -136,8 +139,8 @@ bool DesktopCaptureChooseDesktopMediaFunction::RunSync() {
136139
picker_->Show(web_contents,
137140
parent_window,
138141
parent_window,
139-
target_name,
140-
target_name,
142+
app_name,
143+
app_name,
141144
media_list.Pass(),
142145
callback);
143146
return true;

src/api/screen/screen.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,14 @@ void Screen::Call(DispatcherHost* dispatcher_host,
164164
// Screen Picker GUI is still active, return false;
165165
result->AppendBoolean(false);
166166
}
167+
} else if (method == "CancelChooseDesktopMedia") {
168+
if (gpDCCDMF) {
169+
gpDCCDMF->Cancel();
170+
gpDCCDMF = NULL;
171+
result->AppendBoolean(true);
172+
} else {
173+
result->AppendBoolean(false);
174+
}
167175
}
168176

169177
}

src/api/screen/screen.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ require('util').inherits(Screen, exports.Base);
109109
// Override the addListener method.
110110
Screen.prototype.on = Screen.prototype.addListener = function(ev, callback) {
111111
if ( ev != "displayBoundsChanged" && ev != "displayAdded" && ev != "displayRemoved" && ev != "chooseDesktopMedia")
112-
throw new String('only following event can be listened: displayBoundsChanged, displayAdded, displayRemoved');
112+
throw new TypeError('only following event can be listened: displayBoundsChanged, displayAdded, displayRemoved');
113113

114114
var onRemoveListener = function (type, listener) {
115115
if (this._numListener > 0) {
@@ -123,7 +123,7 @@ Screen.prototype.on = Screen.prototype.addListener = function(ev, callback) {
123123

124124
if(this._numListener == 0) {
125125
if (nw.callStaticMethodSync('Screen', 'AddScreenChangeCallback', [ this.id ])[0] == false ) {
126-
throw new String('nw.callStaticMethodSync(Screen, AddScreenChangeCallback) fails');
126+
throw new Error('nw.callStaticMethodSync(Screen, AddScreenChangeCallback) fails');
127127
return;
128128
}
129129
process.EventEmitter.prototype.addListener.apply(this, ["removeListener", onRemoveListener]);
@@ -154,6 +154,9 @@ Screen.prototype.chooseDesktopMedia = function(array, callback) {
154154
return false;
155155
}
156156

157+
Screen.prototype.cancelChooseDesktopMedia = function() {
158+
return nw.callStaticMethodSync('Screen', 'CancelChooseDesktopMedia', [ this.id ])[0];
159+
}
157160
// ======== Screen functions End ========
158161

159162
// Store App object in node's context.

src/api/shortcut/shorcut.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var v8_util = process.binding('v8_util');
2222

2323
function Shortcut(option) {
2424
if (typeof option != 'object')
25-
throw new String('Invalid option.');
25+
throw new TypeError('Invalid option.');
2626

2727
if (!option.hasOwnProperty('key'))
2828
throw new TypeError("Shortcut requires 'key' to specify key combinations.");

src/api/tray/tray.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ var v8_util = process.binding('v8_util');
2222

2323
function Tray(option) {
2424
if (typeof option != 'object')
25-
throw new String('Invalid option');
25+
throw new TypeError('Invalid option');
2626

2727
if (!option.hasOwnProperty('title') && !option.hasOwnProperty('icon'))
28-
throw new String("Must set 'title' or 'icon' field in option");
28+
throw new TypeError("Must set 'title' or 'icon' field in option");
2929

3030
if (!option.hasOwnProperty('title'))
3131
option.title = '';
@@ -52,15 +52,15 @@ function Tray(option) {
5252

5353
if (option.hasOwnProperty('click')) {
5454
if (typeof option.click != 'function') {
55-
throw new String("'click' must be a valid Function");
55+
throw new TypeError("'click' must be a valid Function");
5656
} else {
5757
this.click = option.click;
5858
}
5959
}
6060

6161
if (option.hasOwnProperty('menu')) {
6262
if (v8_util.getConstructorName(option.menu) != 'Menu')
63-
throw new String("'menu' must be a valid Menu");
63+
throw new TypeError("'menu' must be a valid Menu");
6464

6565
// Transfer only object id
6666
v8_util.setHiddenValue(this, 'menu', option.menu);
@@ -130,7 +130,7 @@ Tray.prototype.__defineGetter__('menu', function() {
130130

131131
Tray.prototype.__defineSetter__('menu', function(val) {
132132
if (v8_util.getConstructorName(val) != 'Menu')
133-
throw new String("'menu' property requries a valid Menu");
133+
throw new TypeError("'menu' property requries a valid Menu");
134134

135135
v8_util.setHiddenValue(this, 'menu', val);
136136
nw.callObjectMethod(this, 'SetMenu', [ val.id ]);

src/api/window_bindings.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,10 @@ Window.prototype.__defineSetter__('menu', function(menu) {
221221
return;
222222
}
223223
if (v8_util.getConstructorName(menu) != 'Menu')
224-
throw new String("'menu' property requries a valid Menu");
224+
throw new TypeError("'menu' property requries a valid Menu");
225225

226226
if (menu.type != 'menubar')
227-
throw new String('Only menu of type "menubar" can be used as this.window menu');
227+
throw new TypeError('Only menu of type "menubar" can be used as this.window menu');
228228

229229
v8_util.setHiddenValue(this, 'menu', menu);
230230
CallObjectMethod(this, 'SetMenu', [ menu.id ]);
@@ -432,7 +432,7 @@ Window.prototype.setBadgeLabel = function(label) {
432432

433433
Window.prototype.setProgressBar = function(progress) {
434434
if (typeof progress != "number")
435-
throw new String('progress must be a number');
435+
throw new TypeError('progress must be a number');
436436
CallObjectMethod(this, 'SetProgressBar', [ progress ]);
437437
}
438438

@@ -442,7 +442,7 @@ Window.prototype.setTransparent = function(transparent) {
442442

443443
Window.prototype.setPosition = function(position) {
444444
if (position != 'center' && position != 'mouse')
445-
throw new String('Invalid postion');
445+
throw new TypeError('Invalid postion');
446446
CallObjectMethod(this, 'SetPosition', [ position ]);
447447
}
448448

src/browser/chrome_crash_reporter_client.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ bool ChromeCrashReporterClient::ReportingIsEnforcedByPolicy(
284284
return true;
285285
}
286286
#endif
287-
return false;
287+
return true;
288288
}
289289
#endif // defined(OS_WIN)
290290

@@ -326,8 +326,7 @@ size_t ChromeCrashReporterClient::RegisterCrashKeys() {
326326
}
327327

328328
bool ChromeCrashReporterClient::IsRunningUnattended() {
329-
scoped_ptr<base::Environment> env(base::Environment::Create());
330-
return env->HasVar(env_vars::kHeadless);
329+
return true;
331330
}
332331

333332
bool ChromeCrashReporterClient::GetCollectStatsConsent() {

0 commit comments

Comments
 (0)