Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.8.2, 6.9.0
-
None
-
QT: v.6.8.2 (I added v.6.9.0 since it is expected to work the same, but that has issue with showing the standardContextMenu also, see: https://bugreports.qt.io/browse/QTBUG-136241)
EMSDK: 3.1.56
Source code: https://hyperborg.com/cp/main.cpp
Description
Description:
When running a Qt application compiled to WebAssembly (WASM) and accessed via a web browser, clipboard access is normally restricted unless triggered by a user gesture (e.g., clicking a button or performing a keyboard shortcut). However, modern browsers (such as Chrome, Firefox) allow overriding this restriction by granting clipboard permissions at the domain level.
Issue:
Even when clipboard access has been explicitly allowed for the domain (e.g., via browser settings), the Qt application's context menu does not enable the "Paste" option by default. This is contrary to expected behavior—when the domain has clipboard access, user gestures should no longer be required, and "Paste" should be fully functional through the context menu.
Expected Behavior:
- If clipboard permissions are granted for the domain:
-
- The application should recognize clipboard access as available.
-
- The "Paste" option in the context menu should be enabled by default.
-
- No user gesture should be required to access clipboard contents.
Current Behavior:
- Clipboard access remains dependent on a user gesture, even when domain-level permissions are granted.
- As a result, the "Paste" context menu entry remains disabled unless a manual user gesture is performed prior.
Steps to Reproduce:
- Run a Qt WASM application here: https://hyperborg.com/cp/v6.8.2/copypaste.html
- Right mouse button to get context menu (Paste is disabled)
3. In the browser, grant clipboard permissions for the domain (e.g., chrome://settings/content/clipboard).
4. Reload the application.
5. Right-click on the input field and observe the context menu.
6. Note that "Paste" remains disabled despite clipboard access being allowed.
Additional Notes:
- This affects UX significantly in web-deployed Qt apps.
- Clipboard access should be re-evaluated in context menu logic based on current browser permissions, not just user gesture history.