Skip to content

Fix copy when focused on the browser's address bar.#11

Open
lingceng wants to merge 1 commit intowdhongtw:masterfrom
lingceng:patch-1
Open

Fix copy when focused on the browser's address bar.#11
lingceng wants to merge 1 commit intowdhongtw:masterfrom
lingceng:patch-1

Conversation

@lingceng
Copy link
Copy Markdown

@lingceng lingceng commented Aug 3, 2024

No description provided.

@wdhongtw wdhongtw self-assigned this Aug 9, 2024
@wdhongtw
Copy link
Copy Markdown
Owner

Hi @lingceng , thanks for the PR.

The ability to support copy when focusing on address bar looks appealing,
but the usage on deprecated interface document.execCommand discourage me from accepting this.
(Actually the first working version of this extension does use document.execCommand, in a slightly different way.)

Also, would you like to elaborate a little abount the scenario where you are copying link without page focus?
Actually I didn't notice this limitation before this PR , so I'm interested about how you use this extension normally. :D

@wdhongtw
Copy link
Copy Markdown
Owner

@lingceng
Copy link
Copy Markdown
Author

Thank you for your reply.

The specific scenario is that sometimes I accidentally click on the address bar, and clicking the copy button doesn't work.

I understand the security scenario you're referring to, and recently I've noticed that using the execCommand approach throws errors on some Lark documents where modifications aren't allowed, so it's not a perfect solution either.

Perhaps we could provide a prompt when the current text is not focused and cannot be copied?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants