1j01 / jspaint

🎨 Classic MS Paint, REVIVED + ✨Extras
https://jspaint.app/about
MIT License
7.16k stars 562 forks source link

Error trying to paste a screenshot on Windows 11 #336

Open 1j01 opened 3 months ago

1j01 commented 3 months ago

Trying to paste a screenshot into jspaint.app, I got an error:

TypeError: blob is null

read_image_file@https://jspaint.app/src/functions.js:3515:2
paste_image_from_file@https://jspaint.app/src/functions.js:1578:17
@https://jspaint.app/src/app.js:1381:26
dispatch@https://jspaint.app/lib/jquery-3.4.1.min.js:2:42571
add/v.handle@https://jspaint.app/lib/jquery-3.4.1.min.js:2:40572

DataTransferItem's getAsFile method can return null even when kind is "file" -- WHY??

> item
DataTransferItem { kind: "file", type: "image/png" }

> item.getAsFile()
null
> item.getAsString()
Uncaught TypeError: DataTransferItem.getAsString: At least 1 argument required, but only 0 passed
    <anonymous> debugger eval code:1
    <anonymous> https://jspaint.app/src/app.js:1381
    jQuery 2
debugger eval code:1:6
> item.getAsString((string)=> console.log("got string:", String))
undefined 

This occurred when trying to paste a screenshot of a notification from Windows 11 prompting me to disable notifications from Firefox, even though there haven't been any, and it's very ironically the only annoying notification I'm experiencing. The notification can't be turned off through any proper means.. Is Windows blocking saving the screenshot while the notification's ellipsis menu is open? I wasn't able to save the screenshot.