aboutsummaryrefslogtreecommitdiffstats
path: root/forcefocuscontent.js
diff options
context:
space:
mode:
authoranekos2010-06-21 16:56:48 +0000
committeranekos2010-06-21 16:56:48 +0000
commit2085a2cd899c737e9c80ffe1486ea55b5bc7d6a3 (patch)
tree583f7c3ae962619ba20046520d7630c079932cf0 /forcefocuscontent.js
parent5a1870e3c8cb8bbd77d2e5776af0ba0e365a3ac4 (diff)
downloadvimperator-plugins-2085a2cd899c737e9c80ffe1486ea55b5bc7d6a3.tar.bz2
revert
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@37854 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'forcefocuscontent.js')
-rw-r--r--forcefocuscontent.js33
1 files changed, 5 insertions, 28 deletions
diff --git a/forcefocuscontent.js b/forcefocuscontent.js
index 7c97029..e8a5d3e 100644
--- a/forcefocuscontent.js
+++ b/forcefocuscontent.js
@@ -11,39 +11,16 @@ var PLUGIN_INFO =
</VimperatorPlugin>;
//}}}
-if (__context__.__addedEventListener)
- getBrowser().removeEventListener("load", __context__.__addedEventListener, true);
-
getBrowser().addEventListener("load", onPageLoad, true);
-
function onPageLoad(event)
{
- try {
let doc = event.originalTarget;
if (doc != getBrowser().contentDocument)
return;
-
- let eproto = doc.defaultView.wrappedJSObject.HTMLInputElement.prototype;
- let original = eproto.focus;
-
- let ignore = function () { return void 0; };
- let remove = function () {
- liberator.log('removed');
- eproto.focus = original;
- if (handle)
- clearTimeout(handle);
- };
-
- doc.defaultView.wrappedJSObject.HTMLInputElement.prototype.focus = ignore;
-
- //let handle = setTimeout(remove, 5000);
-
- liberator.log('injected');
- } catch (e) {
- liberator.log(e);
- }
+ setTimeout(function () {
+ let focused = document.commandDispatcher.focusedElement;
+ if (focused)
+ focused.blur();
+ }, 100);
}
-
-__context__.__addedEventListener = onPageLoad;
-
// vim: fdm=marker sw=4 ts=4 et: