Skip to content

Clipboard API doesn’t work on Codespaces (using Safari) #106997

Closed

Description

  • VSCode Version: Codespaces
  • OS Version: MacOS Catalina and iPadOS 13

Steps to Reproduce:

It seems the Clipboard API is not working, at least using Safari

  1. Create an extension using the Clipboard API which as documented, should be used on Remote Development: env.clipboard.writeText(editor.document.getText(editor.selection));
  2. Open Codespaces and install the extension (My alefragnani.copy-word extension does exactly that)
  3. Use its command Copy Word: Copy, which will select the word where the cursor is located and should copy the selected text to clipboard
  4. Navigate to other location
  5. Run Paste command (or use Cmd V shortcut)
  6. Doesn’t work: instead of pasting the the newly selected/copied text, it pastes the previous clipboard content (not created using the extension)
  • I tested on iPadOS 13 and MacOS Catalina and it fails.
  • I tested on Edge (Chromium) and it works perfectly (I guess it should work on Chrome too)
  • I didn’t test on Firefox (yet).

BTW, I tried to debug my extension on Codespaces (on iPadOS), but it seems not possible/supported. I’m able to build the extension and hit the Debug button. The Debug toolbar appears but no [development ] window/tab appears. Is there a way to debug VSCode extensions right from Codespaces?.

As described below, debugging on Desktop (macOS Catalina) works just fine. Safari just blocks the window, but you click the button and the [development ] window correctly appears.

Does this issue occur when all extensions are disabled?: Yes

Activity

  1. changed the title [-]Clipboard API doesn’t work on Codespaces[/-] [+]Clipboard API doesn’t work on Codespaces (using Safari)[/+] on Sep 18, 2020
  2. alefragnani commented on Sep 18, 2020

    @alefragnani
    Author

    Updated the description and comments. Testing on Edge (Chromium) worked just fine.

  3. added
    safari
    web
    editor-clipboard
    on Sep 21, 2020
  4. bpasero commented on Sep 21, 2020

    @bpasero
    Contributor

    Alessandro Fragnani (@alefragnani)

    BTW, I tried to debug my extension on Codespaces, but it seems not possible/supported. I’m able to build the extension and hit the Debug button. The Debug toolbar appears but no [development ] window/tab appears. Is there a way to debug VSCode extensions right from Codespaces?

    Yes, it should open a new tab. Maybe it was blocked?

  5. alefragnani commented on Sep 21, 2020

    @alefragnani
    Author

    Hi Benjamin Pasero (@bpasero) ,

    Sorry about not updating the description properly. I tested debugging again later (yesterday) and indeed it was blocked by Safari, but only on Desktop (macOS Catalina). On iPadOS, it doesn't display anything (neither a blocked windows warning/icon), so I couldn't debug, yet.

    I'll update the description. Thanks

  6. removed
    safari
    on Sep 21, 2020
  7. alefragnani commented on Sep 24, 2020

    @alefragnani
    Author

    Benjamin Pasero (@bpasero) I think the safari label should remain, because the issue is happening using Safari, both on MacOS and iPadOS.

  8. added
    safari
    on Sep 25, 2020
  9. 7 remaining items

  10. removed
    bug
    on Nov 5, 2020
  11. TylerLeonhardt commented on Aug 27, 2021

    @TylerLeonhardt
    Member
  12. removed their assignment
    on Oct 22, 2021
  13. added
    unreleased
    on Dec 23, 2021
  14. added
    insiders-released
    and removed
    unreleased
    on Jan 3, 2022
  15. TylerLeonhardt commented on Jan 3, 2022

    @TylerLeonhardt
    Member

    verification steps:

    • Open insiders.vscode.dev/github/microsoft/vscode on Safari (bonus points for it being on iPad but it doesn't matter)
    • Install the GHPR extension
    • Go to a random line in a file
    • Run the GitHub Issues: Copy GitHub Permalink command

    Your clipboard should contain the copied permalink now.

    Bonus points: make sure Edge or Chrome still also work.

  16. removed
    upstream
    on Jan 3, 2022
  17. alefragnani commented on Jan 4, 2022

    @alefragnani
    Author

    Hi TylerLeonhardt ,

    I’m glad to report that it is also working on iPadOS 15.2 and MacOS Big Sur 🚀

    I just tested my Copy Word extension (the reason why I opened this issue) and it is working perfectly.

    Thank you!

  18. locked and limited conversation to collaborators on Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

editor-clipboardinsiders-releasedios-ipadossafariweb

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions