-
Notifications
You must be signed in to change notification settings - Fork 23
/
externalAppButtonM.uc.js
282 lines (263 loc) · 25.3 KB
/
externalAppButtonM.uc.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
// ==UserScript==
// @name externalAppButtonM.uc.js
// @namespace ithinc#mozine.cn
// @description External Applications button
// @include main
// @author ithinc & lastdream2013
// @charset UTF-8
// @version 20130616.1.1.6 tidy and merge moveable code
// @version 20130504.1.1.3 delay load exefile, may speedup firefox startup
// @version 20130414.1.1.0 support submenu
// @version 20130402.1.0.1 start modified by lastdream2013, add app menu
// @version 20091216.1.0.0 Final release
// @version 20091215.0.0.2 Handle toolbar apps and menu apps separately
// @version 20091212.0.0.1 Initial release
// ==/UserScript==
var gExternalAppbuttonM = {
autohideEmptySubDirs: true, //自动隐藏没有一个子项目的子目录菜单
moveSubDirstoBottom: false, //把主菜单下的子目录移动到最下面
moveablePositonOrInsertafter: false, //true : ToolbarPalette moveable button false: insert appbutton in "insertafter"
insertafter: 'urlbar-icons', // useless if moveablePositonOrInsertafter is true; urlbar-icons addon-bar TabsToolbar alltabs-button
toolbar: {
//在这里定义好主菜单下子目录的名字,以及图标(可定义或留空,好图标不好找....); 可在中间加{name: 'separator'}建立一个目录与目录之间的分隔线
subdirs: [
{name: 'windows工具', image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAADvUlEQVQ4jZXUX0wUBBzA8R+JY4czRxzcGWqZD5SgIgoJd0doSoaMKwSXYIqYhAP/gWPDdGlPbllYE9haohAC4/gXjoADNVI4FQyUvxegEHZ3HCogKYvavj2E3ms8fB9/n+338PuJiDh5RedGLNleYF0SW8is2l5g9YrOjRARJxER50XbLlhjztzlQLGVgyU2kossJBdZSCmxkmKwklJqJbVyhMNlNg6V2jhYYuNAsZWYM3dZtO2CVUScRURcvLaeI/L0ACvSe/BJ6yQ1b5CO358y9vQfuv94RnrRMKs+68HveC9+x8yszOhlRXoPkacH8Np6DhFxERFRLNRnE/6FGZ+DHXgnt9LSN4FtfBrL+DQjE9N8ZxwmLf8eG0528dahO7y5vx3flHbCjvewUJ+NiChERFzV4Zm8d6wD78Tb6FJbePBwmiH7XwyN/tfOL2/Rfu8JoxN/0/rbE0w9E1xpf8z6I7dRh2ciIq4iIq6em06xKb2NN+KukZbTyZ17k5i6H9M7/JS7g5NsTLtMn2UK84Nn9FumGLBO8fm5LkL2N+G56ZQDUoaeYP2BW7wec5WVH9fzmr6EZVHF+O0oZX/mTQ5900L7wKSj/knWJxnRJV1DGXrCAblpMwjdZ2JxRC25l+5jHppkaGSKmhtWQj6tQ3/kKlXXLdzoHqe5Y4yvL3bhtbmcd5KacNNmOKAFgYfR7LpK6J4GWrrG+aX9EY1tjzB1jrE5uYGjWW0s1xezPPIiyzbn4as38OrGSnQJjSwIPOyA5q/eR0BMDemnW6m/YX/Rjz9beD+pjtbuccxDf/Jr7xi9g5PszLiOKqSS4B1XmL96nwOa55tAwAd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kTqGnj6EtHEKdO4CnzSI/bAbiYVu4CvXyKM76EHaxHyvfjSlfwMicQE8dRUseRP28j9rMXjwtgRxvAqTBUMlVcjVjZSwwlp+gyw/QpUH0TBQtfQst1Yu62I2a7EKdv4xTmRbZe6HaNrB0u/VqJtY+JkXbK1Kszf5jo222FGtTM9HW4b/Z/n+XHynp6NSPz0b4AAAAAElFTkSuQmCC"},
{name: 'firefox目录', image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACEElEQVQ4jd3SvWtTURzG8Q7ubv4BCi5tVUgTEB0FcXIRXXwDEdR2kCqFimALNhHEQmkUBbEUtUOpdSgOTmIFX9Lapk1sbm7TmLQ2NMHm5r7f3JfzdbA2wcFFJx944PyWzzkHfi0t/0eyU6FkYfqsW3x3vqnnXPnV4ZWFyT27Zsd37/y9b/padmwD8lTYESIABAgBW2fPrrD2obO++r7T+dX12V57PXG9KL3cf7IBTHbUhG/jfBvEzA9hFkawihMIT0EEBsLXEb76c/aqELh1eTKcbnxhPKIFroqZj2PkhtG+9LOZuEJlpgslNYCy2IeSvEF1vofqfDeeXSb7IqQ3AR2uZ22gpONU5+5QfnsNq/wJ4Wtbt2sIv9Z4AQJ5PGI3gOcRFwQEDgQW+CbC1/EtCacUx14bwPrag7l8CUM6jW9kkJ+Gm4DRcF34Fr72EU95jft9gvrGY+y1u1iFm1i5LszsGYyl4+ipI/h6EnmkCZAfhZ3A1XA3p6iXn+GU7mOvDmDlezCXL2JkTqGnj6EtHEKdO4CnzSI/bAbiYVu4CvXyKM76EHaxHyvfjSlfwMicQE8dRUseRP28j9rMXjwtgRxvAqTBUMlVcjVjZSwwlp+gyw/QpUH0TBQtfQst1Yu62I2a7EKdv4xTmRbZe6HaNrB0u/VqJtY+JkXbK1Kszf5jo222FGtTM9HW4b/Z/n+XHynp6NSPz0b4AAAAAElFTkSuQmCC" },
{name: 'firefox配置文件', image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUg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ZvDWDviZo9aXl15Wl59ea03LrBnI/e0CtN+1IjVYdoKctJZX1ZxcGiZg7/YKbg5z7Scuvm3jle+/6r/l9E3rT3AA8mrAAAAABJRU5ErkJggg==" },
],
//1.在这里定义好想要出现在主菜单下,或在主菜单子目录下的程序(subdir没有定义, 或在上面子目录名列表中找不到名称相匹配的[比如写错了], 就会出现在主菜单下面);
//2. 可在中间加{name: 'separator'}, 分隔线如果定义了子目录名,就出现在子目录下面;没有定义就在主目录下面.
//3. 这里定义的可以重复. 例如IE浏览器我想出现在windows工具下面, 又想出现在子菜单下面, 那么就定义二次:
// {name: 'IE浏览器', path: 'C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE', args: ['%u'], subdir: 'windows工具' },
// {name: 'IE浏览器', path: 'C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE', args: ['%u'] },
// 就可以了, 建议先写完上面想要定义, 分类在子目录下的程序, 之后从中摘出你最常用的, 去掉后面的subdir定义, 放在最下面
apps: [
{name: 'IE浏览器', path: 'C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE', args: ['%u'], subdir: 'windows工具' },
{name: '记事本', path: 'C:\\Windows\\notepad.exe', subdir: 'windows工具'},
{name: '计算器', path: 'C:\\Windows\\System32\\calc.exe', subdir: 'windows工具'},
{name: '命令行', path: 'C:\\WINDOWS\\system32\\cmd.exe', subdir: 'windows工具'},
/*
{name: 'HyperSnap 7', path: 'E:\\software\\HyperSnap 7\\HprSnap7.exe', subdir: '常用工具'},
{name: 'Photoshop', path: 'E:\\software\\Photoshop7.0\\Photoshop.exe', subdir: '常用工具'},
{name: 'separator', subdir: '常用工具'},
{name: 'Total Commander', path: 'E:\\software\\Total Commander\\TOTALCMD.EXE', subdir: '常用工具' },
{name: 'Everything', path: 'E:\\software\\Everything\\Everything.exe', subdir: '常用工具' },
{name: 'HostsX', path: 'E:\\software\\HostsX\\HostsX.exe', subdir: '常用工具'},
{name: 'Lingoes', path: 'E:\\software\\Lingoes\\Lingoes.exe', subdir: '常用工具'},
{name: 'PDFXCview', path: 'E:\\software\\PDF Viewer\\PDFXCview.exe', subdir: '常用工具'},
{name: 'Goagent', path: 'E:\\software\\ProxyTools\\goagent\\local\\goagent.exe', subdir: '网络工具'},
{name: 'opera', path: 'E:\\software\\Opera\\opera.exe', args: ['%u'], subdir: '网络工具'},
{name: 'Becky!', path: 'E:\\software\\Becky!\\B2.exe', subdir: '网络工具'},
{name: 'QQ', path: 'E:\\software\\QQ2013\\Bin\\QQ.exe', subdir: '网络工具'},
{name: 'AliIM', path: 'E:\\software\\AliWangWang\\AliIM.exe', subdir: '网络工具'},
{name: 'Fetion', path: 'E:\\software\\Fetion2012\\Fetion.exe', subdir: '网络工具'},
{name: 'Thunder', path: 'E:\\software\\Thunder7.2.11.3788JayXon\\Program\\Thunder.exe', subdir: '网络工具'},
{name: 'foobar2000', path: 'E:\\software\\Foobar2000\\foobar2000.exe', subdir: '图像影音'},
{name: 'PotPlayer', path: 'E:\\software\\PotPlayer\\PotPlayerMini.exe', subdir: '图像影音'},
{name: 'Imagine', path: 'E:\\software\\Imagine\\Imagine.exe', subdir: '图像影音'},
{name: 'i_view32', path: 'E:\\software\\IrfanView\\i_view32.exe', subdir: '图像影音'},
{name: 'Inpaint.exe', path: 'E:\\software\\Inpaint\\Inpaint.exe', subdir: '图像影音'},
{name: 'MangaMeeya', path: 'E:\\software\\MangaMeeya\\MangaMeeya.exe', subdir: '图像影音'},
{name: 'openCanvas', path: 'E:\\software\\openCanvas\\oC55.chs.exe', subdir: '图像影音'},
{name: 'EmEditor', path: 'E:\\software\\EmEditor\\EmEditor.exe', subdir: '编辑工具'},
{name: 'SublimeText2', path: 'E:\\software\\SublimeText2\\SublimeText.exe', subdir: '编辑工具'},
{name: 'AkelPad', path: 'E:\\software\\AkelPad\\AkelPad.exe', subdir: '编辑工具'},
{name: 'SourceInsight', path: 'E:\\software\\SourceInsight\\Insight3.exe', subdir: '编辑工具'},
{name: 'WinHex', path: 'E:\\software\\WinHex\\WinHex.exe', subdir: '编辑工具'},
{name: 'Software', path: 'E:\\software', subdir:'常用目录'},
{name: 'Downloads', path: 'I:\\Downloads', subdir:'常用目录'},
{name: 'TDDownloads', path: 'I:\\TDDownload', subdir:'常用目录'},
*/
{name: 'profile', path: '\\', subdir:'firefox目录'},
{name: 'chrome', path: '\\chrome', subdir:'firefox目录'},
{name: 'CSS', path: '\\chrome\\CSS', subdir:'firefox目录'},
{name: 'SubScript', path: '\\chrome\\SubScript', subdir:'firefox目录'},
{name: 'UserScriptLoader', path: '\\chrome\\UserScriptLoader', subdir:'firefox目录'},
{name: 'userChrome.css', path: '\\chrome\\userChrome.css', subdir:'firefox配置文件'},
{name: 'userContent.css', path: '\\chrome\\userContent.css', subdir:'firefox配置文件'},
{name: 'prefs.js', path: '\\prefs.js', subdir:'firefox配置文件'},
{name: 'user.js', path: '\\user.js', subdir:'firefox配置文件'},
// 建议把要放在子目录下的程序定义在上面, 下面的定义放在主菜单下的最常用的程序
/* {name: 'separator'},
{name: 'HyperSnap 7', path: 'E:\\software\\HyperSnap 7\\HprSnap7.exe'},
{name: 'Photoshop', path: 'E:\\software\\Photoshop7.0\\Photoshop.exe'},
{name: 'Everything', path: 'E:\\software\\Everything\\Everything.exe'},
{name: 'HostsX', path: 'E:\\software\\HostsX\\HostsX.exe'},
{name: 'separator'},
{name: 'Goagent', path: 'E:\\software\\ProxyTools\\goagent\\local\\goagent.exe'},
{name: 'Thunder', path: 'E:\\software\\Thunder7.2.11.3788JayXon\\Program\\Thunder.exe'},
{name: 'EmEditor', path: 'E:\\software\\EmEditor\\EmEditor.exe'},
{name: 'SourceInsight', path: 'E:\\software\\SourceInsight\\Insight3.exe'},
{name: 'separator'},
{name: 'Software', path: 'E:\\software'},
*/
{name: 'chrome', path: '\\chrome'},
],
},
subdirPopupHash : [],
subdirMenuHash : [],
_externalAppPopup : null,
_isready : false,
init : function () {
this.handleRelativePath(this.toolbar.apps);
var ExternalAppBtn = document.createElement('toolbarbutton');
ExternalAppBtn.id = "gExternalAppbuttonM-ID";
ExternalAppBtn.setAttribute("label", "外部程序按钮");
ExternalAppBtn.setAttribute("onclick", "event.preventDefault();event.stopPropagation();");
ExternalAppBtn.setAttribute("tooltiptext", "外部程序按钮,可以自定义外部程序和路径");
ExternalAppBtn.setAttribute("class", "toolbarbutton-1 chromeclass-toolbar-additional");
ExternalAppBtn.setAttribute("type", "menu");
ExternalAppBtn.setAttribute("removable", "true");
ExternalAppBtn.setAttribute("image", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADcklEQVQ4jWWT7U+aBxTFn+/8LfswkqbTJWucMZuN6zTrXupmUzur9X2uIGq164xWFOO68PJIsYCo6GQIxaFF0cegRkBofKhWoKXosCjVDbvalgS9Zx/arJv7JTc3J7nnfjqHYY6hNbuEPfopVmdbDGqt8wda6/yBzra43qOfYrVml/D4/T/IDA5Bm2ZCrRzl0m4+BE8gDE8gDO+b7Q6EoTJx6VbNhFpmcAj+YxbJDILKLhOnveOisRkPxpxuMjvdMDvdr/WMl8ZmvBib8ZLO5qKyjmFOJDO8fVLV/au6QWWBVG+HvHcYS9+VIVz1Ce43n8Mwq0CHdhxS/W9vxo4GlYVKO4bUDMMwTGWXWZhdrUx/06LF100aGqgpx37dO3Rw6wRemN4jF1sMjb2NamU/40KLgr6VdqFcJqfsakW6+PqAkDnbMsievMQis0yNzEsqLDeexgtzBlIrp5AKZ6H/thgPnv6IhY0voPflo8FZgDOSGzhZIsdp8W2WyW8yhIQVOsqsG0FeTR/tKzLwjMuiV+FsvNzJpX7zLfy+b6LVnatwhM9Q1+x5ZFzuoxNV/cgV6ULMqVpd6oN6M3KabCi8akQ7a4TS7IJmyA5W1YY5fhI7z514uKfAfPRzXBttRI7EiqwGK96vMaSYHIk59dG1u5R3/S4qjH5S8nF4t5L05NlLDE77qddqgXZyhIycEnJrPV3sMeJTKUd5bU58KLGkmKJuZyhfyqGgfRpiexgdy1uYeryH4O5zjEw7cPiKx/7TO0hsiHAQyUWZeg6FrAef9SzgnNQZYkrkC+zZmwtU0ruEclOI6rkNKPk4WdbimFsepMODARz91UxHu7lY95dQsf4eig08FfZ6UXRzgWXEWp/wS4U7XT7E44IxgPO/rODi+BrE06tIxktx9EcBjrazcPjwXZhmf0KlJYgKUxBFfffSlVrf62iLR1fVl03rVDsRoStzG7iytElidwTWFSVtrn+FROBj8npK0TK7TN9PRVFte0R1o6vqt1E28ALR+CNONBujRk8crfcT6A7toieUwI21J2jmY2jwxyDxbEHsikE0+ZgTGfhjfXDwgtbFmLrJu53uXt8lTTQJw2aS9JtJsNE/qTO4iyb/dvqHxZha5Dhm/jddvriwcy3BKiN7IXYjmVJFkyl5ZC/U+SDBtvvi/6vz31LBdk6sWYzpAAAAAElFTkSuQmCC");
var ExternalAppPopup = document.createElement('menupopup');
ExternalAppPopup.setAttribute('onpopupshowing', 'event.stopPropagation();gExternalAppbuttonM.onpopupshowing();');
this._externalAppPopup = ExternalAppPopup;
ExternalAppBtn.appendChild(ExternalAppPopup);
setTimeout(function () { //延时加载菜单,不对启动造成影响,也不影响第一次打开菜单时的响应速度
gExternalAppbuttonM.loadSubMenu();
}, 3000);
document.insertBefore(document.createProcessingInstruction('xml-stylesheet', 'type="text/css" href="data:text/css;utf-8,' + encodeURIComponent(
'\
#gExternalAppbuttonM-ID {\
-moz-appearance: none !important;\
border-style: none !important;\
border-radius: 0 !important;\
padding: 0 3px !important;\
margin: 0 !important;\
background: transparent !important;\
box-shadow: none !important;\
-moz-box-align: center !important;\
-moz-box-pack: center !important;\
min-width: 18px !important;\
min-height: 18px !important;\
}\
#gExternalAppbuttonM-ID > .toolbarbutton-icon {\
max-width: 18px !important;\
padding: 0 !important;\
margin: 0 !important;\
}\
#gExternalAppbuttonM-ID dropmarker{display: none !important;}\
') + '"'), document.documentElement);
if (this.moveablePositonOrInsertafter) {
var navigator = document.getElementById("navigator-toolbox");
if (!navigator || navigator.palette.id !== "BrowserToolbarPalette")
return;
navigator.palette.appendChild(ExternalAppBtn);
this.updateToolbar();
} else {
var navigator = document.getElementById(this.insertafter);
if (!navigator)
return;
navigator.insertBefore(ExternalAppBtn, navigator.firstChild);
}
},
loadSubMenu : function () {
if (this._isready)
return;
if (this._externalAppPopup == null)
return;
var ExternalAppPopup = this._externalAppPopup;
for (var i = 0; i < this.toolbar.subdirs.length; i++) {
if (this.toolbar.subdirs[i].name == 'separator') {
ExternalAppPopup.appendChild(document.createElement('menuseparator'));
} else {
var subDirItem = ExternalAppPopup.appendChild(document.createElement('menu'));
var subDirItemPopup = subDirItem.appendChild(document.createElement('menupopup'));
subDirItem.setAttribute('class', 'menu-iconic');
subDirItem.setAttribute('label', this.toolbar.subdirs[i].name);
subDirItem.setAttribute('image', this.toolbar.subdirs[i].image);
gExternalAppbuttonM.subdirPopupHash[this.toolbar.subdirs[i].name] = subDirItemPopup;
gExternalAppbuttonM.subdirMenuHash[this.toolbar.subdirs[i].name] = subDirItem;
}
}
for (var i = 0; i < this.toolbar.apps.length; i++) {
var appsItems;
if (this.toolbar.apps[i].name == 'separator') {
appsItems = document.createElement('menuseparator');
} else {
appsItems = document.createElement('menuitem');
appsItems.setAttribute('class', 'menuitem-iconic');
appsItems.setAttribute('label', this.toolbar.apps[i].name);
appsItems.setAttribute('image', 'moz-icon:file://' + this.toolbar.apps[i].path + '?size=16;');
appsItems.setAttribute('oncommand', "gExternalAppbuttonM.exec(this.path, this.args);");
appsItems.setAttribute('tooltiptext', this.toolbar.apps[i].name);
appsItems.path = this.toolbar.apps[i].path;
appsItems.args = this.toolbar.apps[i].args;
}
if (this.toolbar.apps[i].subdir && gExternalAppbuttonM.subdirPopupHash[this.toolbar.apps[i].subdir])
gExternalAppbuttonM.subdirPopupHash[this.toolbar.apps[i].subdir].appendChild(appsItems);
else
ExternalAppPopup.appendChild(appsItems);
}
if (this.autohideEmptySubDirs) {
for (let[name, popup]in Iterator(gExternalAppbuttonM.subdirPopupHash)) {
if (popup.hasChildNodes()) {
continue;
} else {
gExternalAppbuttonM.subdirMenuHash[name].setAttribute("hidden", "true");
}
}
}
if (this.moveSubDirstoBottom) {
let i = ExternalAppPopup.childNodes.length;
while (ExternalAppPopup.firstChild.getAttribute('class') != 'menuitem-iconic' && i-- != 0) {
ExternalAppPopup.appendChild(ExternalAppPopup.firstChild);
}
}
this._isready = true;
},
onpopupshowing : function () {
if (!this._isready)
this.loadSubMenu();
},
handleRelativePath : function (apps) {
for (var i = 0; i < apps.length; i++) {
if (apps[i].path) {
apps[i].path = apps[i].path.replace(/\//g, '\\').toLocaleLowerCase();
var ffdir = Components.classes['@mozilla.org/file/directory_service;1'].getService(Components.interfaces.nsIProperties).get("ProfD", Components.interfaces.nsILocalFile).path;
if (/^(\\)/.test(apps[i].path)) {
apps[i].path = ffdir + apps[i].path;
}
}
}
},
exec : function (path, args) {
args = args || [];
var args_t = args.slice(0);
for (var i = 0; i < args_t.length; i++) {
args_t[i] = args_t[i].replace(/%u/g, gBrowser.currentURI.spec);
}
var file = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsILocalFile);
file.initWithPath(path);
if (!file.exists()) {
Cu.reportError('File Not Found: ' + path);
return;
}
if (!file.isExecutable()) {
file.launch();
} else {
var process = Cc['@mozilla.org/process/util;1'].createInstance(Ci.nsIProcess);
process.init(file);
process.run(false, args_t, args_t.length);
}
},
updateToolbar : function () {
let toolbars = Array.slice(document.querySelectorAll('#navigator-toolbox > toolbar'));
toolbars.forEach(function (toolbar) {
var currentset = toolbar.getAttribute("currentset");
if (currentset.split(",").indexOf("gExternalAppbuttonM-ID") < 0)
return;
toolbar.currentSet = currentset;
try {
BrowserToolboxCustomizeDone(true);
} catch (ex) {}
});
}
};
gExternalAppbuttonM.init();