forked from alice0775/userChrome.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdontDiveLibrary_loadInBackground.uc.js
More file actions
41 lines (40 loc) · 1.4 KB
/
dontDiveLibrary_loadInBackground.uc.js
File metadata and controls
41 lines (40 loc) · 1.4 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// ==UserScript==
// @name dontDiveLibrary_loadInBackground.uc.js
// @namespace http://space.geocities.yahoo.co.jp/gl/alice0775
// @description 中クリックでライブラリが背面にならないように
// @include chrome://browser/content/places/places.xul
// @compatibility Firefox 3.0 3.1
// @author Alice0775
// @version 2009/01/07
// @Note browser.tabs.loadDivertedInBackground
// ==/UserScript==
(function(){
function getVer(){
const Cc = Components.classes;
const Ci = Components.interfaces;
var info = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo);
// このコードを実行しているアプリケーションの名前を取得する
var ver = parseInt(info.version.substr(0,3) * 10,10) / 10;
return ver;
}
if (getVer() < 4) {
try {
var func = openUILinkIn.toString();
func = func.replace(
'focusElement(w.content);',
'if(!getBoolPref("browser.tabs.loadDivertedInBackground", false)) focusElement(w.content);'
)
eval('openUILinkIn = '+ func);
} catch(e){}
} else {
//4.0
try {
var func = openLinkIn.toString();
func = func.replace(
'w.gBrowser.selectedBrowser.focus();',
'if(!getBoolPref("browser.tabs.loadDivertedInBackground", false)) w.gBrowser.selectedBrowser.focus();'
)
eval('openLinkIn = '+ func);
} catch(e){}
}
})();