Skip to content

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

@alefragnani

Description

@alefragnani
  • 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

Metadata

Metadata

Labels

editor-clipboardEditor clipboard issuesinsiders-releasedPatch has been released in VS Code Insidersios-ipadossafariIssues running VSCode in Web on SafariwebIssues related to running VSCode in the web

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions