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

[Feature] 点击空白 #377

Closed
Higurashi-kagome opened this issue Jun 27, 2021 · 4 comments
Closed

[Feature] 点击空白 #377

Higurashi-kagome opened this issue Jun 27, 2021 · 4 comments
Labels

Comments

@Higurashi-kagome
Copy link

很好用,非常感谢!

注意到使用 f 开启链接提示之后,只会提示所有可点击的链接,我遇到的问题是,有时没有任何链接是我所想要点击的,而仅仅是希望通过点击背景等空白处来退出焦点,所以是否能在 f 命令触发后添加一个点击页面空白处的按键选项?

@gdh1995
Copy link
Owner

gdh1995 commented Jun 27, 2021

退出文本框焦点按下 <esc>,强制 blur 不是文本框的元素的话,长按 <esc>,一般都能成功blur

@Higurashi-kagome
Copy link
Author

对于弹窗之类的元素,按 <esc> (包括长按)似乎并不能够达到目的:

Details

demo

@gdh1995
Copy link
Owner

gdh1995 commented Jun 27, 2021

看起来是弹窗自己没做好焦点控制。

主要问题是“空白”没法很好地定义出来,“四周”有可能有侧边栏、菜单、漂浮广告、浮层按钮、置顶提示之类的一堆东西,而且扩展程序是没法像人一样“找出一块只有一种颜色的地方”的。直接点 <body> 也不一定有用,很可能事件绑定到了 <div id="app"> 之类的子元素上。

在有的网站上,你按 f 然后随便点个别的,比如一般是左上角会有个绑定到整个页面的提示按钮,可以退出对话框。只是,看起来你这个截图的网站不好这么做。

建议是,使用 map Fe openUrl url="javascript:document.querySelect('.cls1#id2').click()" 这种方式直接指定 JS,就能用来取消了,或者 map Fe LinkHints.click direct="element" match=".cls1#id2,[data-close]" 来让 LinkHints 对它模拟点击。

@Higurashi-kagome
Copy link
Author

好的,该方法基本能够解决我所遇到的问题。谢谢!

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

2 participants