Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javascript Clipboard access broke #7695

Closed
VuiMuich opened this issue May 9, 2023 · 7 comments
Closed

Javascript Clipboard access broke #7695

VuiMuich opened this issue May 9, 2023 · 7 comments
Labels
bug: behavior Something doesn't work as intended, but doesn't crash. component: QtWebEngine Issues related to the QtWebEngine backend, based on Chromium. qt: 6 Issues related to Qt 6.

Comments

@VuiMuich
Copy link

VuiMuich commented May 9, 2023

Version info:
qutebrowser v2.5.4
Git commit: bb302db-dirty on master (2023-05-08 17:21:20 +1200)
Backend: QtWebEngine 6.5, based on Chromium 108.0.5359.220 (from api)
Qt: 6.5.0

Does the bug happen if you start with --temp-basedir?:

not tested

Description
since installing an update via the aur/qutebrowser-qt6-git package yesterday copying to clipboard via javascript buttons seems to be broken, even though c.content.javascript.clipboard = "access" (or access-paste) is configured.

How to reproduce
Easiest example is the clone repo menu on github:
2023-05-09-105817_422x340_scrot
I also tried to :set -u github.com content.javascript.clipboard access (or access-paste) with no luck.

Am I missing some change or is this really broken?

@The-Compiler The-Compiler added component: QtWebEngine Issues related to the QtWebEngine backend, based on Chromium. qt: 6 Issues related to Qt 6. labels May 9, 2023
@The-Compiler
Copy link
Member

I also noticed some trouble with this recently, but haven't looked into it in more detail yet. It might be a Qt 6.5 regression...

@The-Compiler The-Compiler added the bug: behavior Something doesn't work as intended, but doesn't crash. label May 9, 2023
@VuiMuich
Copy link
Author

VuiMuich commented May 9, 2023

Thanks, at least I am not to dumb to read change logs 😅

When there is something to test, feel free to ping me.

@toofar
Copy link
Member

toofar commented May 13, 2023

I tried to debug this today but gave up and raised an issue upstream: https://bugreports.qt.io/browse/QTBUG-113579
Hopefully they can reproduce it.

As an aside, there was some discussion recently on IRC over the confusing setting descriptions around this.
They currently read:

  • none: Disable access to clipboard.
  • access: Allow reading from and writing to the clipboard.
  • access-paste: Allow accessing the clipboard and pasting clipboard content

After some brief testing around this I don't think access allows the website to read the clipboard, only write to it. I think having the mixed terminology in there makes it worse. The none and access-paste options use "access" and "paste" terminology but the access setting mentions "read" and "write".
IMO the meaning of "access" and "paste" are not very clear and I would propose changing them to "Allows the website to write to (and read from) the clipboard".
Although it might be worth trying to squeeze something in there about the "user interaction" stuff. For example if you set it to "none" and use the code block copy buttons on this page they still work fine: https://web.dev/async-clipboard/

@toofar
Copy link
Member

toofar commented May 27, 2023

The upstream fix has landed and applies cleanly to 6.5.1 (and probably 6.5.0 but I haven't tested that). It'll be in 6.6 and 6.5.2.
I'm not sure what we can do in the meantime. It might be possible to "polyfill" the copy action to use whatever the code blocks on that web.dev site are using to bypass the permission API (probably it's just something that is more unambiguously tied to a user action).

pld-gitsync pushed a commit to pld-linux/qt6 that referenced this issue May 31, 2023
@The-Compiler
Copy link
Member

For what it's worth, the demo on https://web.dev/async-clipboard/ doesn't copy anything at all for me either on QtWebEngine 6.5.1.

@tblancher
Copy link

This appears to be fixed for me, as of QtWebEngine 6.5.2.

@The-Compiler
Copy link
Member

Yep, fixed upstream!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: behavior Something doesn't work as intended, but doesn't crash. component: QtWebEngine Issues related to the QtWebEngine backend, based on Chromium. qt: 6 Issues related to Qt 6.
Projects
None yet
Development

No branches or pull requests

4 participants