-
Notifications
You must be signed in to change notification settings - Fork 2
/
greasemonkey.ks.js
36 lines (35 loc) · 1.24 KB
/
greasemonkey.ks.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
var PLUGIN_INFO =
<KeySnailPlugin>
<name>Greasemonkey</name>
<description>Greasemonkey Util for KeySnail</description>
<version>0.0.1</version>
<updateURL>http://github.com/hogelog/keysnail-plugins/raw/master/greasemonkey.ks.js</updateURL>
<author mail="[email protected]" homepage="http://hogel.org/">hogelog</author>
<license>CC0</license>
<minVersion>1.5.0</minVersion>
<include>main</include>
<provides>
<ext>greasemonkey-execute-command</ext>
</provides>
<options>
</options>
<detail><![CDATA[]]></detail>
</KeySnailPlugin>;
ext.add("greasemonkey-execute-command", function () {
var menuItems = GM_BrowserUI.getCommander(content).menuItems;
if (menuItems.length == 0) {
display.echoStatusBar("No Greasemonkey Menu Command");
return false;
}
var commandList = [menuItems[i].getAttribute('label') for (i in menuItems)];
prompt.selector({
message: "Menu Command (Greasemonkey)",
callback: function (index) {
var item = menuItems[index];
return item._commandFunc();
},
header: ["Command"],
collection: commandList,
});
}, "Execute Greasemonkey Menu Command");
// vim: fenc=utf-8 sw=4 ts=4 et: