| 1 | // |
|---|
| 2 | // prevent_focus_ietab.js |
|---|
| 3 | // |
|---|
| 4 | // LICENSE: {{{ |
|---|
| 5 | // Copyright (c) 2009 snaka<snaka.gml@gmail.com> |
|---|
| 6 | // |
|---|
| 7 | // Distributable under the terms of an new BSD style license. |
|---|
| 8 | // }}} |
|---|
| 9 | // |
|---|
| 10 | // PLUGIN INFO: {{{ |
|---|
| 11 | var PLUGIN_INFO = |
|---|
| 12 | <VimperatorPlugin> |
|---|
| 13 | <name>prevent_focus_ietab</name> |
|---|
| 14 | <description>This plugin prevents focusing IETab automaticaly.</description> |
|---|
| 15 | <description lang="ja">IETabに勝手にフォーカスを奪われてそうさ不能になるのを防ぐ</description> |
|---|
| 16 | <minVersion>2.0pre</minVersion> |
|---|
| 17 | <maxVersion>2.0</maxVersion> |
|---|
| 18 | <updateURL>http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/prevent_focus_ietab.js</updateURL> |
|---|
| 19 | <author mail="snaka.gml@gmail.com" homepage="http://vimperator.g.hatena.ne.jp/snaka72/">snaka</author> |
|---|
| 20 | <license>MIT style license</license> |
|---|
| 21 | <version>1.0.1</version> |
|---|
| 22 | <detail><![CDATA[ |
|---|
| 23 | == Subject == |
|---|
| 24 | This plugin prevents IEtab get focusing with mannerless. |
|---|
| 25 | == Usage == |
|---|
| 26 | Place this file to vimp's plugin directory. That's all. |
|---|
| 27 | ]]></detail> |
|---|
| 28 | <detail lang="ja"><![CDATA[ |
|---|
| 29 | == 概要 == |
|---|
| 30 | IETabにフォーカスを勝手に奪われて操作不能になるのを防ぐ。 |
|---|
| 31 | == 使い方 == |
|---|
| 32 | vimpのpluginディレクトリにこのファイルを格納してください。それだけです。 |
|---|
| 33 | ]]></detail> |
|---|
| 34 | </VimperatorPlugin>; |
|---|
| 35 | // }}} |
|---|
| 36 | |
|---|
| 37 | (function() { |
|---|
| 38 | if (!gIeTab || !gIeTab.onTabSelected) |
|---|
| 39 | return; |
|---|
| 40 | |
|---|
| 41 | liberator.log("replace IeTab.onTabSelected() function"); |
|---|
| 42 | var func = gIeTab.onTabSelected.toSource(); |
|---|
| 43 | var newFunc = func.replace(/window\.setTimeout\(gIeTab\.focusIeTab, 0\);/, ''); |
|---|
| 44 | gIeTab.removeEventListener("appcontent", "select", gIeTab.onTabSelected); |
|---|
| 45 | gIeTab.addEventListener("appcontent", "select", new Function(newFunc)); |
|---|
| 46 | })(); |
|---|
| 47 | |
|---|
| 48 | // vim:sw=2 ts=2 et si fdm=marker: |
|---|