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

[新标签页打开链接] 我有一个想法不知道能不能实现 #336

Open
2584191127 opened this issue Mar 26, 2023 · 3 comments
Open
Labels
功能建议 新功能 或 建议

Comments

@2584191127
Copy link

功能需求

就是当点击链接时把左键模拟成ctrl+左键或者鼠标中键

预期目标

也许可以实现所有网站通用吧

@2584191127 2584191127 added the 功能建议 新功能 或 建议 label Mar 26, 2023
@XIU2
Copy link
Owner

XIU2 commented Mar 26, 2023

实现不了,至少我实现不了。

@2584191127
Copy link
Author

实现不了,至少我实现不了。

好吧

@gigberg
Copy link

gigberg commented Apr 5, 2023

能实现,不过意义不大。提供一个思路:①先监听左键点击事件,并且阻止默认行为e.preventDefault()+e.stopPropagation(),②然后构造一个虚拟的鼠标中键事件elem.dispatchEvent(event),保证两个事件的[Event.target]一致

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
功能建议 新功能 或 建议
Projects
None yet
Development

No branches or pull requests

3 participants