nw.js icon indicating copy to clipboard operation
nw.js copied to clipboard

clipboard.get Freezes nw application.

Open prominentdetail opened this issue 1 year ago • 7 comments

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 avatar Oct 26 '23 21:10 prominentdetail

@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 avatar Oct 31 '23 18:10 ayushmanchhabra

@ayushmanchhabra were you able to interact with the scrollbars and also resize the window?

prominentdetail avatar Oct 31 '23 19:10 prominentdetail

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.

prominentdetail avatar Oct 31 '23 19:10 prominentdetail

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.

prominentdetail avatar Jan 19 '24 19:01 prominentdetail

I have reproduced this with 0.83.0. Additionally, clip.readAvailableTypes() returns only "text,html" although I've copied an image.

sysrage avatar Jan 19 '24 19:01 sysrage

Simplified reproduction. This causes NW.js to crash immediately:

{
  "name": "test",
  "main": "index.html"
}
<!DOCTYPE html>
<script>
  nw.Clipboard.get().get('png');
</script>

TheJaredWilcurt avatar Jan 19 '24 20:01 TheJaredWilcurt

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.

TheJaredWilcurt avatar Jan 20 '24 15:01 TheJaredWilcurt