侦听来自浏览器和QUOT活动;查找和QUOT;窗口在JavaScript中 [英] Listen for Events from Browser "Find" Window in JavaScript

查看:148
本文介绍了侦听来自浏览器和QUOT活动;查找和QUOT;窗口在JavaScript中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有听rel=\"nofollow\">的JavaScript 输入到浏览器的查找窗口中

Is there a way to listen for typing into the browser's "find" window in JavaScript?

我希望能够reinter preT从JavaScript搜索文本。什么我需要添加一个事件侦听器?

I'd like to be able to reinterpret the search text from JavaScript. What do I need to add an event listener for?

推荐答案

我不知道有什么方法可以侦听的找到的样事件,如果这是在任何浏览器支持它肯定是不是一个便携式解决方案。

I don't know of any way you can listen for a find-like event and if that's supported in any browser it sure isn't a portable solution.

我不知道你想达到什么样的,但我认为你最好的选择是听触发查找窗口的键盘事件,并试图取消它们试图仿效查找-工具栏/窗口用自己的的JavaScript。然而,这是一个艰巨的(几乎不可能)的任务,由于某些浏览器取决于本地化的键盘快捷键自定义(例如,在IE中的en-US使用Ctrl + F键(对于的查找的),而PT -PT使用Ctrl + L键(对于的的,这意味着找到))。

I also don't know what you're trying to achieve but I think that your best option is to listen for the keyboard events that trigger the find window and attempt to cancel them while attempting to emulate the find-toolbar/window with JavaScript of your own. This is however a herculean (and nearly impossible) task due to some browsers customization of keyboard shortcuts depending on the localization (for instance, in IE, en-US uses Ctrl+F (for Find) while pt-PT uses Ctrl+L (for Localizar, meaning find)).

结论:我觉得你的运气那里...

Conclusion: I think you're out of luck there...

这篇关于侦听来自浏览器和QUOT活动;查找和QUOT;窗口在JavaScript中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆