Skip to content

Webinterface Copy to Clipboard button throwing error #279

@Schiphorst-ISST

Description

@Schiphorst-ISST

🐞 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:

  1. Build and Run the webinterface
  2. Open the webinterface using the IPv4 HTTP address provided (not localhost!)
  3. Embed a Watermark in a sufficiently long cover text
  4. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions