Bug 501811 - "Copy to clipboard" entry enters unusable data into Klipper.
Summary: "Copy to clipboard" entry enters unusable data into Klipper.
Status: CONFIRMED
Alias: None
Product: plasma-browser-integration
Classification: Plasma
Component: Firefox (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Kai Uwe Broulik
URL: https://discuss.kde.org/t/unable-to-c...
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-21 00:28 UTC by Roke Julian Lockhart Beedell
Modified: 2025-03-21 16:00 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
A Screenshot of the Data, as Rendered inside Klipper's GUI (23.13 KB, image/png)
2025-03-21 00:28 UTC, Roke Julian Lockhart Beedell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roke Julian Lockhart Beedell 2025-03-21 00:28:23 UTC
Created attachment 179620 [details]
A Screenshot of the Data, as Rendered inside Klipper's GUI

SUMMARY

Plasma Integration's "Copy to clipboard" entry enters unusable data into Klipper.

STEPS TO REPRODUCE

1. Visit https://mdn.github.io/dom-examples/web-share/.
2. Select "Share MDN!"
3. Select "Copy to clipboard".
4. Invoke Klipper, and/or attempt to paste.

OBSERVED RESULT

Klipper appears to contain binary data which cannot be pasted into any text entry area.

EXPECTED RESULT

Klipper should contain a UTF-8 URI.

SOFTWARE/OS VERSIONS

> Operating System: Fedora Linux 41  
> KDE Plasma Version: 6.3.3  
> KDE Frameworks Version: 6.12.0  
> Qt Version: 6.8.2  
> Kernel Version: 6.13.7-200.fc41.x86_64 (64-bit)  
> Graphics Platform: Wayland  

ADDITIONAL INFORMATION

Originally confirmed at https://discuss.kde.org/t/unable-to-copy-uri-in-native-browser-share-menu-why/31765/4?u=rokejulianlockhart.
Comment 1 Roke Julian Lockhart Beedell 2025-03-21 00:37:57 UTC
(In reply to Roke Julian Lockhart Beedell from comment #0)
> SOFTWARE/OS VERSIONS

https://addons.mozilla.org/firefox/downloads/file/4298512/plasma_integration-1.9.1.xpi
Comment 2 Kevin Krammer 2025-03-21 08:47:56 UTC
Since I confirmed in the Discuss thread, here are my versions:

Operating System: KDE neon 6.3
KDE Plasma Version: 6.3.3
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.2
Kernel Version: 6.11.0-19-generic (64-bit)
Graphics Platform: X11

Firefox extension 1.9.1
Chrome extension 2.0

Both browsers are native packages
Comment 3 Kai Uwe Broulik 2025-03-21 09:19:12 UTC
Can confirm.

So this issue happens under X11 as well? Then it’s not what I thought. Under Qt Wayland a URL isn’t implicitly added as text to the clipboard whereas Qt XCB does.
Comment 4 Bug Janitor Service 2025-03-21 09:43:01 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/purpose/-/merge_requests/129
Comment 5 Kevin Krammer 2025-03-21 10:03:26 UTC
(In reply to Kai Uwe Broulik from comment #3)
> Can confirm.
> 
> So this issue happens under X11 as well? Then it’s not what I thought. Under
> Qt Wayland a URL isn’t implicitly added as text to the clipboard whereas Qt
> XCB does.

Behavior on X11: entry in Klipper is neither text nor URL but looks like broken images.
Pasting (e.g. into KWrite) results in

> https://developer.mozilla.org/
> Learn web development on MDN!
Comment 6 Kai Uwe Broulik 2025-03-21 16:00:12 UTC
Git commit 04dcb61e1d80149116e8d45055abfcd1248204c7 by Kai Uwe Broulik.
Committed on 21/03/2025 at 15:55.
Pushed by broulik into branch 'master'.

Clipboard: Set clipboard text, too, if applicable

Purpose has no proper API contract for sending just text, it's all sent
as part of "urls".

Try to guess what is an URL (we want to be tolerant in the parser since
we don't really know how strict the input will be) and only set that as URL
and also set everything as text.

M  +19   -11   src/plugins/clipboard/clipboardplugin.cpp

https://invent.kde.org/frameworks/purpose/-/commit/04dcb61e1d80149116e8d45055abfcd1248204c7