-
Notifications
You must be signed in to change notification settings - Fork 123
/
forcefocuscontent.js
26 lines (25 loc) · 844 Bytes
/
forcefocuscontent.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// PLUGIN_INFO//{{{
var PLUGIN_INFO = xml`
<VimperatorPlugin>
<name>{NAME}</name>
<description>force focuscontent</description>
<author mail="[email protected]" homepage="http:https://d.hatena.ne.jp/hogelog/">hogelog</author>
<version>0.1.1</version>
<minVersion>2.0pre</minVersion>
<maxVersion>2.0pre</maxVersion>
<updateURL>https://github.com/vimpr/vimperator-plugins/raw/master/forcefocuscontent.js</updateURL>
</VimperatorPlugin>`;
//}}}
getBrowser().addEventListener("load", onPageLoad, true);
function onPageLoad(event)
{
let doc = event.originalTarget;
if (doc != getBrowser().contentDocument)
return;
setTimeout(function () {
let focused = document.commandDispatcher.focusedElement;
if (focused)
focused.blur();
}, 100);
}
// vim: fdm=marker sw=4 ts=4 et: