vscode-vs-browser icon indicating copy to clipboard operation
vscode-vs-browser copied to clipboard

Keyboard Shortcuts for Copy, Cut, and Paste

Open CodeVachon opened this issue 2 years ago • 9 comments

Excellent work on this extension, I have found it be incredibly useful in my workflow.

One use-cases I have is to open GraphQL Playground in VS Browser. Everything functions as it would in browser with the exception of the use of the Keyboard Shortcuts for Copy, Cut, and Paste in the extension frame.

I have not tried any other Keyboard shortcuts, so I can not confirm if this is limited to clipboard functionality or something broader.

The only workaround I have found is to use the Menu Bar to access that functionality.


Steps to Reproduce

  1. download a repository with a GraphQL Playground Here's an older one for convenience
  2. Install Dependancies and Run the Application: pnpm run dev
  3. Open VS Browser and visit this endpoint on the started server /api/graphql
  4. Copy this Snippit and Paste into the Playground using Keyboard Shortcuts CMD+V
{
  listPokemon(itemsPerPage: 5) {
    name
  }
}

Expected behaviour

Snippit should be able to be pasted into the Editor of the GraphQL Playground

Actual behaviour

No change is observed or error is thrown

CodeVachon avatar Aug 30 '23 20:08 CodeVachon

Sorry for the late response. I have missed this issue notification. I will try to look at it and fix it if can. Thank you for using my extension 🎉

Phu1237 avatar Sep 14 '23 16:09 Phu1237

Thanks for the great work!

I found it is a great alternative for Pluto.jl for VS Code. It lets me use Pluto.jl within VS Code. If the keyboard shortcuts for Copy, Cut, and Paste work within VS Code, it would be wonderful!

Information about Pluto.jl Pluto.jl (alpha preview) - Visual Studio Marketplace https://marketplace.visualstudio.com/items?itemName=JuliaComputing.pluto-vscode

ysaereve avatar Nov 13 '23 11:11 ysaereve

@CodeVachon @ysaereve I'm working on this I need you to confirm some information

  • Are you using VS Code on MacOS
  • Please help me check in case using a website that has input and try to copy and paste it into it (Ex: google.com). Is that work for you?

Because I'm using Windows the copy-and-paste still works as expected Thank you for using my extension! 🎉

Phu1237 avatar Nov 30 '24 04:11 Phu1237

Sorry for the late reply. Regarding your questions:

  1. Yes. I am using Visual Studio Code - Insiders on macOS
  2. Installed Identifier phu1237.vs-browser Version 2.2.0 today to test copy-and-paste

Here are some test that I just performed. Please feel free to me know if you need me to do other tests.

Tests Performed

Works

copy-and-paste to URL address bar

Issues

  1. Cannot display many others, e.g. https://www.google.com/, https://juliahub.com/ with the error like below Refused to display 'https://www.google.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

  2. Cannot copy-and-paste within browser, e.g. https://docs.julialang.org/en/v1/ <ctrl+/> to search, cannot copy-and-paste

Environment

Version: 1.97.0-insider Commit: 70866d528727b9131fc07b0f14869f256059949b Date: 2025-01-07T05:05:41.564Z Electron: 32.2.7 ElectronBuildId: 10660205 Chromium: 128.0.6613.186 Node.js: 20.18.1 V8: 12.8.374.38-electron.0 OS: Darwin arm64 24.2.0

ysaereve avatar Jan 13 '25 13:01 ysaereve

@ysaereve

Cannot display many others, e.g. https://www.google.com/, https://juliahub.com/ with the error like below Refused to display 'https://www.google.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

For this, you should be using Proxy Mode (in setting) or using Start with Proxy in the Ctrl + Shift + P (Windows) command => How to fix issue 1: https://youtu.be/q4XzpqJHyBI

image

image

Cannot copy-and-paste within browser, e.g. https://docs.julialang.org/en/v1/ <ctrl+/> to search, cannot copy-and-paste

I've tested this on Windows and it still works perfectly so I think it is a macOS issue. I don't have a macOS on my own so it may take a while for me to test this As I understand, you can use the shortcut key <ctrl+/> but not copy and paste right? Have you tried to copy the text inside the browser and paste it?

  • Like this: https://youtu.be/p767aJZwG1E

Please help me check those Thank you!

Phu1237 avatar Jan 13 '25 16:01 Phu1237

Thank you for sharing the detail information. The test results are:

  1. With Proxy Mode, yes, I am able to access https://www.google.com/ now.
  2. With in VS Browser, <ctrl+/> works and will trigger search dialogue of https://docs.julialang.org/en/v1/
  3. With in VS Browser, copy-and-paste hot keys do not work as expected.
  4. With in VS Browser, the Menu/Edit/Copy or Paste options work.
  5. With in VS Browser, copy-and-paste hot keys work in URL address bar (as reported in previous comment).

BTW, I am not able to access the second YouTube link https://youtu.be/p767aJZwG1E that you shared.

ysaereve avatar Jan 14 '25 16:01 ysaereve

@ysaereve I've pasted the wrong link 🤣 This is the right link: https://youtu.be/KInatlCySxM

In summary, please help me to check these steps:

  1. CTRL + /
  2. Type something into the search box
  3. CTRL + A (Select all)
  4. CTRL + C
  5. CTRL + V

If step 5 works, I think the macOS is sandboxing the iframe so the clipboard is not shared between the iframe and your OS

I'll investigate this issue when I borrow a macOS because I don't have one so it may take a while if this is a bug

Phu1237 avatar Jan 14 '25 16:01 Phu1237

I was able to confirm that only step 1 and 2 work.

For step 3, 4 and 5, I tested both CTRL+A/C/V and CMD+A/C/V combinations, but unfortunately, neither worked in my testing.

To ensure I pressed the correct key combinations during the tests, I used the EventViewer tool from Karabiner-Elements to verify the input. You can find more details about EventViewer here: EventViewer - Karabiner-Elements Documentation

If you have a macOS setup and would like me to test anything else, please feel free to let me know—I’d be happy to assist!

ysaereve avatar Jan 17 '25 14:01 ysaereve

@ysaereve Thank you for your confirmation! I will try to find the solution based on what you have provided and will let you know if I found anything new Thank you for using my extension 😁

Phu1237 avatar Jan 22 '25 06:01 Phu1237