This is a example to show this issue.
0.24.4-sdk does not have this proble.
0.37.1-sdk and other versions have this proble.
I create a nw app.
The nw app's main page has a webview.
The webview load a local index.html file in folder ./static/html/
and a local index.js file in ./static/js/
.
The webview will prompt a long strig and the main page
will catch this dialog event.
I found the long string will be cut in some vesions of sdk.
- install nw and use 0.24.4-sdk
npm install -g nwjs
nw install 0.24.4-sdk
nw use 0.24.4-sdk
- clone this project and install dependencies
git clone https://github.com/caijw/nwjsApp.git
cd nwjsApp
npm install
- run the static files server
cd nwjsApp
node ./server.js
- run nw app
cd nwjsApp
nw .
The assert result goes well.
Dialog messageText is unbroken.
webview.addEventListener('dialog', function (event) {
var messageText = event.messageText;
assert.strictEqual(messageText, getLongText());
});
- install nw and use 0.37.1-sdk
npm install -g nwjs
nw install 0.37.1-sdk
nw use 0.37.1-sdk
- clone this project
git clone https://github.com/caijw/nwjsApp.git
- run the static files server
cd nwjsApp
node ./server.js
- run nw app
cd nwjsApp
nw .
The asserttion throws a error.
Dialog messageText is cut.
webview.addEventListener('dialog', function (event) {
var messageText = event.messageText;
assert.strictEqual(messageText, getLongText());
});
0.34.5-sdk also has this problem.
Other version sdks may have this proble.