6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

NW.js 0.13変更点のメモ

Last updated at Posted at 2016-02-02

NW.js 0.12→0.13変更点のメモ。
かなりいろいろ変わっているようですが、Migrate from 0.12 to 0.13から、特に気づいたものだけ。

エントリポイントがhtmlファイルからjsファイルになった

従来のようにhtmlファイルにもできるが、その場合はNW.jsのデフォルトのエントリファイルが使用されるらしい。

NW.jsライブラリへのアクセス方法の変更

グローバルオブジェクトnwからアクセスする。
これまでのようなvar gui = require('nw.gui')は不要になった。
ついでにnw.guiライブラリはnwオブジェクトに統合されたらしい。

ついでにrequireもnwオブジェクトに含まれるようになった。
(var hoge = nw.require('hoge.js');という感じで)

0.12
var gui = require('nw.gui');
gui.Window.open('./index.html');
0.13
nw.Window.open('./index.html');

フレーバーの分化

ノーマルフレーバー、SDKフレーバー、NaClフレーバー(GoogleNativeClientを使うためのもの?)に分かれた。
DevToolはSDKフレーバーでしか表示できない。

ツールバーの廃止

Window.open時のオプションtoolbarは常にfalse扱いになる。
DevtoolはWindow.showDevtools関数で開くか、ウィンドウ上でF12で開く。

Window.open時のWindowオブジェクトの取得方法の変更

open関数の返値として返さなくなった。open関数のコールバック関数で返す。

0.12
var gui = require('nw.gui');
var win = gui.Window.open('./example.html');
win.once('close', function() {
     //ウィンドウが閉じた
});
0.13
nw.Window.open('./example.html', {}, function(win) {
     win.once('close', function() {
          //ウィンドウが閉じた
     });
});

一部Windowオプション名の変更

always-on-top visible-on-all-workspacesalways_on_top visible_on_all_workspaces
セパレータ'-'→'_'

6
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?