Skip to content
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

Use system clipboard content than tab url to gen code. #282

Closed
qrqhuang opened this issue Jul 29, 2022 · 9 comments · Fixed by #337
Closed

Use system clipboard content than tab url to gen code. #282

qrqhuang opened this issue Jul 29, 2022 · 9 comments · Fixed by #337
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@qrqhuang
Copy link

I was commonly used clipboard content to generate code.
Try to give an option to choose.

@qrqhuang qrqhuang added the enhancement New feature or request label Jul 29, 2022
@rugk
Copy link
Owner

rugk commented Jul 29, 2022

Good idea. Note that this would require a new permission for clipboard access likely, but that can (and should) be optional, so that's not a big deal.

HowTo

I imagine a setting with a checkbox:

  • Use clipboard content when opening popup.

If you enable that, instead of using the tab URL it should override it (if required also possible with a message from the background script or so with the clipboard content.
If a permission is required, one can couple it in this extension with the PermissionRequest library (also used in other extensions, if one needs to get an example).

Important things:

  • If the clipboard is empty, it should IMHO still fallback/use the website URL then as usual!
  • If some text is selected and the option in the settings is enabled (as usual), this should take preference over the clipboard content IMHO.
    Reasoning: The thing is the clipboard is likely to contain outdated stuff, even passwords or so, which you have copied a quite long time ago, while a text selection on the website is much less permanent (i.e. goes away fast when you have to interact in some other way with the site) and selecting something may be a way more deliberate act than just copying sth. in another application even possibly or so.
  • if a new permission is required please document it/why for the user.

That all said, I guess this is a good „good first issue“ thing if someone wants to really implement it. Note though, it may be not the easiest one, as one has to touch a few topics (settings, actual logic etc.) that are simplified due to the libs we use, but may still require some clever ideas or so.

@rugk rugk added the good first issue Good for newcomers label Jul 29, 2022
@qrqhuang qrqhuang changed the title Use system clipboard content than current website url to gen code. Use system clipboard content than tab url to gen code. Jul 30, 2022
@frooia
Copy link

frooia commented Sep 12, 2022

New open source dev here, can I try this one?

@Ravina-Deogadkar
Copy link

Can I work on this?

@rugk
Copy link
Owner

rugk commented Oct 19, 2022

Hi oh sorry for the delay, missed my notifications, yes you can both try. However, @Ravina-Deogadkar I just saw @frooia already did a PR in #286, so that is the base for implementation.

I thus will assign @frooia first, but if help is needed, of course I assume @Ravina-Deogadkar you can jump in and help here. Feel free to test or review the PR, BTW.

@rugk
Copy link
Owner

rugk commented Nov 2, 2023

So @GrupaIMEX and @Ravina-Deogadkar if you want to take over/finish the PR #286 feel free to do so. There should just be some minor work to do.

@BrandonTuTwo2
Copy link
Contributor

BrandonTuTwo2 commented Sep 12, 2024

Hello! is this issue still available if so may I work on it?

@rugk
Copy link
Owner

rugk commented Oct 16, 2024

Yeah, please just try to build upon the existing work: #286

@BrandonTuTwo2
Copy link
Contributor

will do thanks!

@rugk
Copy link
Owner

rugk commented Nov 9, 2024

Fixed by #337

@rugk rugk closed this as completed Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
5 participants