aboutsummaryrefslogtreecommitdiffstats
path: root/forcefocuscontent.js
blob: e8a5d3e048cfedc9f9bac4155e1894419953e071 (plain)
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 =
<VimperatorPlugin>
    <name>{NAME}</name>
    <description>force focuscontent</description>
    <author mail="konbu.komuro@gmail.com" homepage="http://d.hatena.ne.jp/hogelog/">hogelog</author>
    <version>0.1.1</version>
    <minVersion>2.0pre</minVersion>
    <maxVersion>2.0pre</maxVersion>
    <updateURL>http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/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: