From 78ac6d2d907f50dda8595f61b9426655b0054442 Mon Sep 17 00:00:00 2001 From: snaka Date: Wed, 21 Jan 2009 12:08:48 +0000 Subject: My first plugin git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@28759 d0d07461-0603-4401-acd4-de1884942a52 --- prevent_focus_ietab.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 prevent_focus_ietab.js (limited to 'prevent_focus_ietab.js') diff --git a/prevent_focus_ietab.js b/prevent_focus_ietab.js new file mode 100644 index 0000000..fae6aa1 --- /dev/null +++ b/prevent_focus_ietab.js @@ -0,0 +1,23 @@ +/* + +prevent_focus_ietab.js + +Prevent focusing IE Tab when select a tab that renderd in IE Tab plugin. +IE Tab に勝手にフォーカスを奪われて操作不能になるのを防ぐ + +Copyright (c) 2009, snaka. +All rights reserved. +This software distribute under term of new BSD style license. + +*/ +(function() { + +if (gIeTab && gIeTab.onTabSelected) { + liberator.log("replace IeTab.onTabSelected() function"); + var func = gIeTab.onTabSelected.toSource(); + var newFunc = func.replace(/window\.setTimeout\(gIeTab\.focusIeTab, 0\);/, ''); + gIeTab.removeEventListener("appcontent", "select", gIeTab.onTabSelected); + gIeTab.addEventListener("appcontent", "select", new Function(newFunc)); +} + +})(); -- cgit v1.2.3