-
Notifications
You must be signed in to change notification settings - Fork 3
Webinterface Copy to Clipboard button throwing error #279
Description
🐞 Bug Report
Describe the Bug
The "Copy to Clipboard" button, after successfully embedding a watermark, (sometimes?) throws an error, see the full message below.
Update: The issue arises due to the clipboard API only being available in secure contexts. Older, deprecated methods (like Document.exec) could provide a workaround but likely not worth the effort and potential future risks of using deprecated code.
To Reproduce
Steps to reproduce the behavior:
- Build and Run the webinterface
- Open the webinterface using the IPv4 HTTP address provided (not localhost!)
- Embed a Watermark in a sufficiently long cover text
- Click "Copy to Clipboard" on the Result screen
Expected Behavior
The watermarked cover should be copied to clipboard
System Information
- Component: webinterface
- Runtime: ubuntu 24.04 LTS, chrome browser
- Version: any branch
Additional Context
Full in-browser error text as follows:
Uncaught runtime errors:
ERROR
Cannot read properties of undefined (reading 'writeText')
TypeError: Cannot read properties of undefined (reading 'writeText')
at eval (webpack-internal:///./kotlin/webinterface/WatermarkTextEmbedTab.mjs:715:32)
at Object.eval (webpack-internal:///./kotlin/kvision-project-kvision/io/kvision/html/Button.mjs:405:5)
at invokeHandler (webpack-internal:///../../node_modules/snabbdom/build/modules/eventlisteners.js:8:17)
at handleEvent (webpack-internal:///../../node_modules/snabbdom/build/modules/eventlisteners.js:22:9)
at HTMLButtonElement.handler (webpack-internal:///../../node_modules/snabbdom/build/modules/eventlisteners.js:27:9)