How do I disable Firefox's “Search for text when I start typing” on pages with keyboard shortcuts?

心不动则不痛 提交于 2019-12-04 15:39:26

问题


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?


回答1:


To disable this in firefox, just go to Tools->Options->Advanced->General Tab 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.




回答2:


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:

  • zty.pe - JS browser typing game. Would be pretty bad if typing caused searching here. It actually captures the keys just when the game starts and NOT by default on the page.



回答3:


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!



来源:https://stackoverflow.com/questions/4602277/how-do-i-disable-firefoxs-search-for-text-when-i-start-typing-on-pages-with-k

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!