如何禁用 Firefox 的“开始输入时搜索文本”功能在带有键盘快捷键的页面上?
一些网页,如 GMail 和 Reddit(带有 Reddit 增强套件)有我想使用的有用的键盘快捷键。但是,每当我开始在其中一个页面上打字时,第一个 onkeypress 事件就会触发,但随后“开始打字时搜索文本”搜索栏会打开并阻止更多按键。
我不想禁用“开始输入时搜索文本”,因为我在大多数其他网页上使用它。有什么方法可以有选择地禁用它,或者创建键盘快捷键/书签来切换它?
Some web pages such as GMail and Reddit(with the Reddit Enhancement Suite) have useful keyboard shortcuts that I'd like to use. However, whenever I start typing on one of these pages, the first onkeypress event fires, but then the "Search for text when I start typing" search bar opens and blocks further keys.
I don't want to disable "Search for text when I start typing" as I use it on most other web pages. Is there any way to selectively disable it, or to make a keyboard shortcut/bookmarklet to toggle it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
要在 Firefox 中禁用此功能,只需转到“选项 -> 常规选项卡 -> 浏览”并禁用“开始输入时搜索文本”。更多信息 此处 。这在某些情况下非常有用,例如当您尝试玩 WebGL 游戏或使用页面时像 Gmail 或 Protonmail 都有自己的知识库快捷方式
更新到版本 73.0.1 - 在以前版本的 Firefox 中,它位于“工具 -> 选项 -> 高级 -> 常规选项卡”或在“首选项->常规->浏览”中
To disable this in firefox, just go to "Options->General Tab->Browsing and disable "Search for text when I start typing". More info here . This is very useful in some cases, for example when you try to play WebGL games or when using pages like Gmail or Protonmail that have their own kb shortcuts.
UPDATED to version 73.0.1- In previous versions of Firefox this is in "Tools->Options->Advanced->General Tab" or in "Preferences->General->Browsing"
这仍然是一个问题吧?我喜欢这个功能,但它也时不时地困扰我。有一些页面是正确的。我从来没有深入研究过他们是如何做到的。例如:
This is still an issue huh? I love this feature but It also bothers me every now and then. There are some pages that get it right. I never dug into how they do it. For instance:
这不是 Firefox 或任何其他浏览器的功能。为此,您必须编写服务器端和客户端代码。
捕获用户在输入中键入的文本,并最好使用 AJAX 将其发送到服务器端脚本。然后服务器端脚本应该在数据库(某些搜索引擎)中查找匹配项,并返回可能的组合。您在客户端(JS)所需要做的就是以某种好的方式显示返回的结果 - 就像在谷歌中一样 - 您可以使用例如简单的 html 列表,但您必须编写一些 css 使其看起来正确。另外一个不错的功能是编写 JS 代码以在上/下键上工作并输入以选择元素(它也应该适用于鼠标)。
自己做起来并不是很简单,但是您现在已经知道如何做了。你也可以用谷歌搜索一些脚本 - 肯定有一些东西:)
祝你好运!
That is not Firefox or any other browser feature. To do this, you have to write server and client side code.
Catch text that user types into input, and send it using preferably AJAX to server-side script. Then server side script should look up for matches in DB (some search engine), and return possible combinations. All you have to do on client side (JS) is to show returned results in some nice way - like in google - you can use for example simple html lists, but you have to code some css to make it look properly. Also nice feature is to code JS to work on up/down keys and enter for selecting element (it should also work for mouse).
It's not very simple to do by yourself, but you have now idea how to do it. You could also google for some scripts - surely there is something :)
Good luck!