Skip to content

Restore gesture requirement for async clipboard write access #16890

Closed
brave/brave-core
#14901

Description

@ShivanKaul

Chromium 66+ implements Asynchronous Clipboard API. Chromium, in contrast to Safari and Firefox, allow a website to write to the user's clipboard using navigator.clipboard.writeText()/write() without a user gesture (only criteria is that the tab should be active).

We should require a user gesture (click, touch events) to enable use of navigator.clipboard.writeText() and navigator.clipboard.write(). Else, promise should reject.

Demo website that attempts to write to the user's clipboard: https://shivankaul.com/brave/clipboard-paste.html (if you get a success message, try to paste)

Activity

  1. ShivanKaul commented on Oct 1, 2021

    @ShivanKaul
    CollaboratorAuthor
  2. markg85 commented on Aug 28, 2022

    @markg85

    Could this be re-evaluated?
    Personally i really don't like this clipboard feature at all and want it gone in it's entirety.. That's probably not going to happen so please put it behind a permission request at the very least.

  3. androolloyd commented on Aug 30, 2022

    @androolloyd

    Am here to voice concern over this, its incredibly invasive and I would like to see it removed entirely from the Brave engine.

  4. self-assigned this
    on Aug 30, 2022
  5. added
    priority/P2A bad problem. We might uplift this to the next planned release.
    and removed
    priority/P4Planned work. We expect to get to it "soon".
    on Aug 30, 2022
  6. bsclifton commented on Aug 30, 2022

    @bsclifton
    Member

    When it's time to try the fix, we'll need to go shields down to test the test page when fixing as EasyList is blocking what is required to test the gesture

  7. 8 remaining items

  8. kjozwiak commented on Sep 7, 2022

    @kjozwiak
    Member

    The above will require 1.43.91 or higher for 1.43.x verification 👍

  9. LaurenWags commented on Sep 8, 2022

    @LaurenWags
    Member

    Verified with

    Brave | 1.43.91 Chromium: 105.0.5195.102 (Official Build) (x86_64)
    -- | --
    Revision | 4c16f5ffcc2da70ee2600d5db77bed423ac03a5a-refs/branch-heads/5195_55@{#4}
    OS | macOS Version 12.5.1 (Build 21G83)
    

    Reproduced the issue using 1.43.88 and STR from brave/brave-core#14901 (comment).
    Checked with shields up and shields down as per #16890 (comment).

    1.43.88 Shields Up 1.43.88 Shields Down
    1 3
    2 4

    Verified issue does not occur with 1.43.91. Checked with shields up and shields down.
    When pasting in a new tab, my clipboard was no overwritten, it was the same text I had prior to visiting the page.

    1.43.91 Shields Up 1.43.91 Shields Down
    1 3
    2 4

    Note - Per brave/brave-core#14901 (comment), if you see "NotAllowedError" message this is ok as well. I did see this when changing shield settings.

  10. added and removed
    QA/In-ProgressIndicates that QA is currently in progress for that particular issue
    on Sep 8, 2022
  11. MadhaviSeelam commented on Sep 8, 2022

    @MadhaviSeelam

    Verification PASSED using

    Brave | 1.43.91 Chromium: 105.0.5195.102 (Official Build) (64-bit)
    -- | --
    Revision | 4c16f5ffcc2da70ee2600d5db77bed423ac03a5a-refs/branch-heads/5195_55@{#4}
    OS | Windows 11 Version 21H2 (Build 22000.856)
    

    Reproduced the issue using 1.43.89 and STR from brave/brave-core#14901 (comment).
    Checked with shields up and shields down as per #16890 (comment).

    1.43.89 Shields Up 1.43.89 Shields Down
    image image
    image image

    Verified issue does not occur with 1.43.91. Checked with shields up and shields down.
    When pasting in a new tab, my clipboard was not overwritten, it was the same text I had prior to visiting the page.

    1.43.91 Shields Up 1.43.91 Shields Down
    image image

    Note - Per brave/brave-core#14901 (comment), if you see "NotAllowedError" message this is ok as well. I did see this when changing shield settings. (Refreshed the page and the error message was dismissed)

  12. btlechowski commented on Sep 12, 2022

    @btlechowski

    Verification passed on

    Brave 1.43.92 Chromium: 105.0.5195.102 (Official Build) (64-bit)
    Revision 4c16f5ffcc2da70ee2600d5db77bed423ac03a5a-refs/branch-heads/5195_55@{#4}
    OS Ubuntu 18.04 LTS

    Verified brave/brave-core#14901

    Reproduced in 1.43.88
    Verified in 1.43.92

    Details shields on ![image](https://user-images.githubusercontent.com/34715963/189639263-4d473d42-2d7a-46cf-a314-cb040c9785a0.png)

    shields down
    image

  13. srirambv commented on Sep 13, 2022

    @srirambv
    Contributor

    Verification passed on Oppo Reno 5 with Android 12 running 1.43.92 x64 build

    • Reproduced the issue on 1.43.88
    • Verified with both Shields Up/Down
    1.43.88 1.43.92
    image image

    Verification passed on Samsung Tab A with Android 10 running 1.43.92 x64 build

    • Reproduced the issue on 1.43.88
    • Verified with both Shields Up/Down
    1.43.88 1.43.92
    image image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions