Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 81
copy/paste fix (v1)#36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
532218507173e6bef7302679bec5ad20ded443dff4File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| // src/plugins/globalPaste.ts | ||
| import { PluginObject } from 'vue' | ||
| const GlobalPaste: PluginObject<undefined> = { | ||
| install() { | ||
| document.addEventListener( | ||
| 'keydown', | ||
| async (e: KeyboardEvent) => { | ||
| if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === 'v') { | ||
| e.preventDefault() | ||
| console.log(`[vue:globalPaste]:call`) | ||
| try { | ||
| const text = await navigator.clipboard.readText() | ||
| console.log(`[vue:globalPaste]:payload:` , text) | ||
| await fetch('http://localhost:10001/computer/paste', { | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. using localhost here won't work in prod ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. on it 👍 note : Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes definitely--this is why we added the click/move mouse stuff into the API. I think eventually we will go deeper on that front There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Hardcoded URL Causes Production Environment IssuesThe Locations (2) | ||
| method: 'POST', | ||
| headers: { 'Content-Type': 'application/json' }, | ||
| body: JSON.stringify({ text }), | ||
| }) | ||
| } catch (err) { | ||
| console.error('paste proxy failed', err) | ||
| } | ||
| } | ||
| }, | ||
| { capture: true } | ||
| ) | ||
| }, | ||
| } | ||
| export default GlobalPaste | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider the security implications of logging clipboard data. Clipboard content could contain sensitive information like passwords, API keys, or personal data. While this logging is helpful for debugging, you may want to either:
console.log('[clipboard] EVENT.CONTROL.CLIPBOARD:', text.substring(0, 50) + '...'))This is particularly important since the browser console can be accessed by users or browser extensions.
Type: Security | Severity: High