nw.js
nw.js copied to clipboard
clipboard.get Freezes nw application.
var clipboard = nw.Clipboard.get(); var clip = clipboard.get('png'); freezes the application.
Here is a simple example of the issue. It will paste when the app is run, so copy some text or image first. To make it reliably reproduce the issue, open Paint app on windows and then use the selection tool to copy part of the canvas, then open the min-repro, it will freeze. nwjsClipboardBug.zip
- Operating System: windows 10
- NW.js Versions tested: 80 & 81 & 85 & 86
@prominentdetail Works for me on Linux (Ubuntu 22.04) and Windows 11. Not tested on Windows 10 yet. If someone else is able to repro, that's be great!
@ayushmanchhabra were you able to interact with the scrollbars and also resize the window?
btw, I tested again, and it worked the first time I opened it and pasted an image. But the second time I opened it and pasted text, it didn't work and was frozen.
If you open Paint app on windows and then use the selection tool to copy part of the canvas, then open the repro, it will freeze.
I have reproduced this with 0.83.0. Additionally, clip.readAvailableTypes()
returns only "text,html" although I've copied an image.
Simplified reproduction. This causes NW.js to crash immediately:
{
"name": "test",
"main": "index.html"
}
<!DOCTYPE html>
<script>
nw.Clipboard.get().get('png');
</script>
Tested Versions
Version | Flavor | Arch | OS | Status |
---|---|---|---|---|
0.33.4 | SDK | x64 | Win10 | ✔️ |
0.58.0 | SDK | x64 | Win10 | ✔️ |
0.70.1 | SDK | x64 | Win10 | ✔️ |
0.76.1 | SDK | x64 | Win10 | ✔️ |
0.77.0 | SDK | x64 | Win10 | ✔️ |
0.78.0 | SDK | x64 | Win10 | ❌ Crash |
0.78.1 | SDK | x64 | Win10 | ❌ Crash |
0.79.0 | SDK | x64 | Win10 | ❌ Crash |
0.79.1 | Normal | x64 | Win10 | ❌ Crash |
0.83.0 | SDK | x64 | Win10 | ❌ Crash |
Diff:
- https://github.com/nwjs/nw.js/compare/nw-v0.77.0...nw-v0.78.0
@rogerwang Simple reproduction of crash. Narrowed down the version it was introduced in.