Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
冗長な右クリックメニューを纏めるテスト
// ==UserScript==
// @name iContextMenu.uc.js
// @description 冗長な右クリックメニューを纏める
// @namespace http://d.hatena.ne.jp/Griever/
// @author Griever
// @license MIT License
// @compatibility Firefox 10
// @charset UTF-8
// @include main
// @version 下書き3
// @screenshot http://f.hatena.ne.jp/Griever/20120408171623
// @note
// ==/UserScript==
(function(css){
const PAGE_ITEM = [
{ command: 'context-bookmarkpage', icon: 'starbutton' }
,{
label: 'ページの URL をコピー'
,oncommand: 'Cc["@mozilla.org/widget/clipboardhelper;1"].getService(Ci.nsIClipboardHelper).copyString(content.location.href);'
,icon: 'copy'
}
,{ command: 'context-savepage' }
,{ command: 'context-sendpage', hidden: 'true' }
,{ command: 'context-sep-viewsource' }
,{ command: 'context-viewsource' }
,{ command: 'context-viewinfo' }
,{ command: 'context-viewbgimage' }
,{ command: 'context-sep-viewbgimage' }
,{ command: 'context-back' }
,{ command: 'context-forward' }
,{ command: 'context-reload' }
,{ command: 'context-stop' }
,{ command: 'context-sep-stop' }
,{
label: 'ホームページを開く',
oncommand: 'BrowserGoHome(event);',
icon: 'home'
}
];
const LINK_ITEM = [
{ command: 'context-copylink' }
,{
label: 'リンクを現在のタブに開く'
,icon: 'blank'
,oncommand: 'document.getElementById("context-openlinkincurrent").doCommand(); closeMenus(event.target);'
,onclick: 'checkForMiddleClick(document.getElementById("context-openlinkintab"), event);'
}
,{ command: 'context-openlinkintab' }
,{ command: 'context-openlink' }
,{ command: 'context-sep-open' }
,{ command: 'context-bookmarklink' }
,{ command: 'context-savelink' }
,{ command: 'context-sendlink', hidden: 'true' }
,{ command: 'context-sep-copylink', hidden: 'true' }
];
const IMAGE_ITEM = [
{ command: 'context-viewimage' }
,{ command: 'context-copyimage-contents' }
,{ command: 'context-copyimage' }
,{ command: 'context-sep-copyimage' }
,{ command: 'context-saveimage' }
,{ command: 'context-viewimageinfo' }
,{ command: 'context-sendimage', hidden: 'true' }
,{ command: 'context-setDesktopBackground' }
];
if (window.giContextMenu) {
window.giContextMenu.destroy();
delete window.giContextMenu;
}
window.giContextMenu = {
init: function() {
var contextmenu = document.getElementById("contentAreaContextMenu");
this.add(PAGE_ITEM).setAttribute("condition", "normal");
this.add(LINK_ITEM).setAttribute("condition", "link");
this.add(IMAGE_ITEM).setAttribute("condition", "image");
var ids = [].concat(
['#contentAreaContextMenu #'+command for each({command} in PAGE_ITEM) if (command)]
,['#contentAreaContextMenu[iContextMenu~="link"] #' + command for each({command} in LINK_ITEM) if (command)]
,['#contentAreaContextMenu[iContextMenu~="image"] #' + command for each({command} in IMAGE_ITEM) if (command)]
);
if (ids.length)
css += "\n" + ids.join(", ") + "{ display: none !important; }";
this.xulstyle = addStyle(css);
contextmenu.addEventListener("popupshowing", this, false);
window.addEventListener("unload", this, false);
},
uninit: function() {
var contextmenu = document.getElementById("contentAreaContextMenu");
contextmenu.removeEventListener("popupshowing", this, false);
window.removeEventListener("unload", this, false);
},
destroy: function() {
this.uninit();
if (this.xulstyle) this.xulstyle.parentNode.removeChild(this.xulstyle);
$$('menu.icontextmenu').forEach(function(e) e.parentNode.removeChild(e) );
$$('.icontextmenu').forEach(function(e) e.parentNode.removeChild(e) );
},
handleEvent: function(event) {
switch(event.type){
case "popupshowing":
if (event.target != event.currentTarget) return;
var state = [];
if (gContextMenu.onTextInput)
state.push("input");
if (gContextMenu.isTextSelected)
state.push("select");
if (gContextMenu.onLink)
state.push(gContextMenu.onMailtoLink ? "mailto" : "link");
if (gContextMenu.onImage)
state.push("image");
if (gContextMenu.onVideo || gContextMenu.onAudio)
state.push("media");
event.currentTarget.setAttribute("iContextMenu", state.join(" "));
break;
case "unload":
this.uninit();
break;
}
},
add: function(itemArray) {
var menu = document.createElement("menu");
var popup = menu.appendChild(document.createElement("menupopup"));
var mcls = menu.classList;
mcls.add("icontextmenu");
mcls.add("menu-iconic");
var ins = $("context-openlinkincurrent");
ins.parentNode.insertBefore(menu, ins);
itemArray.forEach(function(obj) {
if (typeof obj === 'undefined') return;
popup.appendChild(this.newMenuitem(obj));
}, this);
let fc = menu.getElementsByTagName("menuitem")[0];
if (fc) {
let cm = fc.getAttribute("command");
if (cm) cm = document.getElementById(cm);
if (cm) {
["label","accesskey"].forEach(function(n){
if (cm.hasAttribute(n)) menu.setAttribute(n, cm.getAttribute(n));
}, this);
}
["image","icon"].forEach(function(n){
if (fc.hasAttribute(n)) menu.setAttribute(n, fc.getAttribute(n));
}, this);
menu.setAttribute("onclick", <![CDATA[
if (event.target != event.currentTarget) return;
var fc = event.currentTarget.getElementsByTagName("menuitem")[0];
if (!fc) return;
if (event.button === 1) {
checkForMiddleClick(fc, event);
} else {
fc.doCommand();
closeMenus(event.currentTarget);
}
]]>.toString());
}
return menu;
},
newMenuitem: function(obj) {
var menuitem;
var org = obj.command ? document.getElementById(obj.command) : null;
// label == separator か必要なプロパティが足りない場合は区切りとみなす
if (!obj || obj.label === "separator" || (!obj.oncommand && !obj.command)) {
menuitem = document.createElement("menuseparator");
} else if (obj.oncommand || obj.command) {
if (org && org.localName === "menuseparator") {
menuitem = document.createElement("menuseparator");
} else {
menuitem = document.createElement("menuitem");
if (!obj.label)
obj.label = obj.command || obj.oncommand;
}
} else {
menuitem = document.createElement("menuitem");
}
if (obj.command)
menuitem.setAttribute("command", obj.command);
if (obj) {
for (let [key, val] in Iterator(obj)) {
if (key === "command") continue;
if (typeof val == "function")
obj[key] = val = val.toSource() + ".call(this, event);";
menuitem.setAttribute(key, val);
}
}
var cls = menuitem.classList;
cls.add("icontextmenu");
if (org) {
// hidden等を同期させる荒業
org.cloneitem = menuitem;
["hidden", "collapsed", "disabled"].forEach(function(n){
if (obj[n]) return;
org.__defineSetter__(n, function(val){
if (this.cloneitem)
this.cloneitem.setAttribute(n, !!val);
this.setAttribute(n, !!val);
return val;
});
org.__defineGetter__(n, function(){
return this.getAttribute(n) == "true";
});
});
}
// separator はここで終了
if (menuitem.localName == "menuseparator")
return menuitem;
cls.add("menuitem-iconic");
if (!obj.onclick)
menuitem.setAttribute("onclick", "checkForMiddleClick(this, event)");
return menuitem;
},
};
window.giContextMenu.init();
function $(id) { return document.getElementById(id); }
function $$(exp, doc) { return Array.prototype.slice.call((doc || document).querySelectorAll(exp)); }
// http://gist.github.com/321205
function $A(args) { return Array.prototype.slice.call(args); }
function U(text) 1 < 'あ'.length ? decodeURIComponent(escape(text)) : text;
function $E(xml, doc) {
doc = doc || document;
xml = <root xmlns={doc.documentElement.namespaceURI}/>.appendChild(xml);
var settings = XML.settings();
XML.prettyPrinting = false;
var root = new DOMParser().parseFromString(xml.toXMLString(), 'application/xml').documentElement;
XML.setSettings(settings);
doc.adoptNode(root);
var range = doc.createRange();
range.selectNodeContents(root);
var frag = range.extractContents();
range.detach();
return frag.childNodes.length < 2 ? frag.firstChild : frag;
}
function addStyle(css) {
var pi = document.createProcessingInstruction(
'xml-stylesheet',
'type="text/css" href="data:text/css;utf-8,' + encodeURIComponent(css) + '"'
);
return document.insertBefore(pi, document.documentElement);
}
})(<![CDATA[
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
#contentAreaContextMenu:not([iContextMenu~="select"]) .icontextmenu[condition~="select"],
#contentAreaContextMenu:not([iContextMenu~="link"]) .icontextmenu[condition~="link"],
#contentAreaContextMenu:not([iContextMenu~="mailto"]) .icontextmenu[condition~="mailto"],
#contentAreaContextMenu:not([iContextMenu~="image"]) .icontextmenu[condition~="image"],
#contentAreaContextMenu:not([iContextMenu~="media"]) .icontextmenu[condition~="media"],
#contentAreaContextMenu:not([iContextMenu~="input"]) .icontextmenu[condition~="input"],
#contentAreaContextMenu[iContextMenu~="select"] .icontextmenu[condition~="noselect"],
#contentAreaContextMenu[iContextMenu~="link"] .icontextmenu[condition~="nolink"],
#contentAreaContextMenu[iContextMenu~="mailto"] .icontextmenu[condition~="nomailto"],
#contentAreaContextMenu[iContextMenu~="image"] .icontextmenu[condition~="noimage"],
#contentAreaContextMenu[iContextMenu~="media"] .icontextmenu[condition~="nomedia"],
#contentAreaContextMenu[iContextMenu~="input"] .icontextmenu[condition~="noinput"],
#contentAreaContextMenu:not([iContextMenu=""]) .icontextmenu[condition~="normal"]
{ display: none !important; }
.icontextmenu:-moz-any([icon="star"], [command^="context-bookmark"]) {
list-style-image: url("chrome://browser/skin/places/editBookmark.png");
-moz-image-region: rect(0px, 16px, 16px, 0px);
}
.icontextmenu:-moz-any([icon="save"], [command^="context-save"]) {
list-style-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAC50lEQVQ4jY2Q21MbBRhH9z+iIRurjv4XvsqlCYQFtNJYIGk7OuNDx4EO1tFpy7VJNCkVrUKhZkN1cHCaALZQB4dL7pEmoblCuptssnt8gOn41OHhPJ7z++YTxJ7AgLlH/soiyRsWSS6KUlATJdmw9MpYpBPe7gvy7kfLvNMv81avXHrvorwu2hc+EARBECySPLGVUNhKqNQaBmrDQKnrlF81OSxrFI4aKHUdVdN5WWkQz9WM5Wf5xofXw3nRPm8VRCm4sxVX+Gw2h6IZKJqOdSRE8bjBYaXBkdKk1jCoKE1S+Tr7mRqBzSLLm3ne/zhQE0QpWN6MK1zzZ6koTSpKE+tIiFxFo1htoGo6Sl0nW9aIZmvsv1BxepL8sV3CbF8yBFEKahvRV1zzZ8iWNbJlja7RMLmyxnFNp6YZlKpN4rk6+xmV3QOVIXeCeysZRPsigijJRjhS5aovQzJfJ5mvky7UKVabqJrOsapzUNBeyzsHCoMzMbyP/8XcvYBg6ZV5slvl6vcvsI6EsI2G6b4Rpu/mOv031+kZW8M2EsL6PxwTe0wHkpi75hEskszqzhEubxqnJ43Tm8blTeHypHB5kgy7kwzOxLk8HcMxFWVgYh/HZIQ7D6OYbT+fBFa2j05kT/pUTOHyphh2Jxm6m2BwJsanUzEckxEuje9xaXyXbx7s0Wr96STw+HkZpyd1SvL1+tDdBIPTMS5PR3FMRhgY3+WT2ztcvP0PN+5v03phDsEiBZA3SzjdKWoN40z0f/s3X/qeY+q8j3C+V+bR0xLD7iSqZnD99843otR1pK+f8YXnKaaOWYTzfTKLG0Wcp4GVyG9vRKnr2Mf+4vOpDUwdfgSLFDDm1wo43YkzX2AbXePKeJiWNp8hiFIgNvfnS+ZWD8/8gyt3QgzfekJLu68giPZfx8z2R4vmnqWiaF9CtD/E3L2AuesXWm0PaLX+iOnCD5g6ZzF13ONcu5+WNp9xru27Sku7f/U/n64QFJ0JfmcAAAAASUVORK5CYII=");
}
.icontextmenu:-moz-any([icon="copy"], [command^="context-copy"]) {
list-style-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABHUlEQVQ4jZWSUYrCQBBES++xi3cQ43k80grexT8RlXznGpEgJDqZ7h6o/UnCaMasO1A/w/C6qqYB4BvACkCW0ALAHH+clapKCIGxvPfcbrc/n0CyEALbtmXTNLzdbizLkiEEOue42+16yDTAe0/nHOu65vV6HZyYGQGsOxezTmOAmdF7z8fjwbquWRQF9/s98zwngE0HSXaTxdN6J4fDgarKT7rJ4gc95Hg88tNustcpIsLT6cSpbkII7OKMAarK8/nMVDdVVQ1ORgAzo5lRVXm5XEaxnHNDnEkHZsY8z0d3IkLnHO/3+xNggfEKrwFsUtFEhG3bPgEQLUivOYB1ypmqDt8bA17PLNVNrH8BUhKRBsDyHeBdN7GWAL5+AXSfOyX5jHKEAAAAAElFTkSuQmCC");
}
.icontextmenu:-moz-any([icon="send"], [command^="context-send"]) {
list-style-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACV0lEQVQ4jcWT3UtTcRzGz7/jlXddFFQSYm84CCIQISS6LCHQ6I3SpvhyhC5aBRVRQuUgNMuIfDnOJm46ceS7m9N5pm5nZ7p5dnbO7/zO9/d0MS/sPvCBz+XzgefikaRjz4NXU8rT3sV8o2+O3+iJUIMcoevyDNV3TVNdZ5iudYToavsUXfFOkqc1SJdbJtxLLYpVc3dArfDIivSsbyluOyQKpgvm4h+cI3AX4AS4BBglDm3fpqpmf0y692ZeHJQ4fN9UxNMMe6bAWoYQ1wgJnZDMEVL7ArsFgZIDbGoM3r4trKYKqO0OCanRFwXjhIHZAnzfVSQyDAVL/FPUDAHLAVSdofPLFp4P56EXbXi6Q5Bu9kTAOGF+m/A1UpZsagwmAzRDIFcUYBzYzjHI/SrejufxY9lFzjgU1LWFwThhOU1Y2CH4J3Po6ItD1RkYL+/f2WNo/xTH67EclJgLJXZE4HkYBOOElQwhmmQYnM7iY1DHyyEV67sWEmkLL4ZU9E7o+BzUEFizMblxKJBDkKqbArA54Y/K8HNORzRpY2mXMLJYxLuxDN6PZTAyX8TCDiGcsNA/ncXvmA39wIanOwzp5K1RYTIXw1EdSymGDV1gIyuQyArEsgLxrMC6JhDTCCtpwuymjcEZDWrWQG3XlJAq6z8k9gybUrop8iZHweIwLI6izWEyFyZzUWIuLObCcsroBYtmVjNWVZN/XarwyEplQ//+idu/nFPNo/zMfYWffTTOzz0e59VPArzGG+DnvQF+oa3MxfYJp6Z1uHj6jj9Z4ZGV437Sf8hf1IBPDl2Qkw0AAAAASUVORK5CYII=");
}
.icontextmenu:-moz-any([command="context-viewsource"], [command="context-viewpartialsource-selection"]) {
list-style-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACAklEQVQ4jY2Tz2sTURSFr/4TIijoQkTBVUrWUlCDbgoK0lCLFBH8gTtrIy5cZNEWRI2LWigFpVCktFhEoWAUrRBiQdomaSI2JqaJ6USaTGYy897Le+Nx4TgYSVoPfMvzweVyiH5nHxH5iMi/AweIaDe1iY9zrkspHaUU2sE5RyQSedhJ4pdSOo1GA5ZledTrddRqNWiaBqUUiqkZZKbO48vzMJYnTmAlcqSfiGgXEfmVUmCMQQgBxhgYYzBNE7quo1KpwCzOoRwdhL76AjBLqK3OIDZ6crNFIITwYIzBtm0YhoHNz9Oort2F2JhH+e0o7MQsVH4RiclLrEUgpfRullKCcw59YwHV5B049iLs7DVsfbyO9NMBfHoc1N+MBA63CP7FKL1GNTEEh8VgrfeDFYIw1kIoPOnBlcDBPrfbXlBKzqG8NOiWL4B960U9eRvZ8dOwSkm4b20vKKXmkV64Ccd+B5YbAC/0QU8MYX0sAEP7CqVUZ0H6/RRSL0NYeXUfxfg5WLkgtpZvITvRA+tHDpzz7QXPhrsBI4/M+FlEQ3vxYSyA2L1TML9nwDnfWRC+fAwi9ggi/gDx8HHMXj2EaiGJZrPpsa2gt3sPhi8eRXTkDJamb6Cu5SGlbKGT4GenHbTBcQVeuoQQllKq45j+LgshTHe9XvYTUdd/zPkPPrdDvwBzfHXHWIsRUwAAAABJRU5ErkJggg==");
}
.icontextmenu:-moz-any([icon="info"], [command="context-viewinfo"], [command="context-viewimageinfo"]) {
list-style-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACtElEQVQ4ja2T20/ScRjG+Vv02gv4dlNb86K5VgwwybYO5DBNPFzgStIUK8WAMCSIQxMxDA9QpGKJSlDgz7SQCYim/nJgBm1tdQMeluXTRRuszXnRerb38vls7/M+L4Pxv1WsXcxn66NStiZKn1CF0oXKYLpQOUcfV76VHmv35h9q5uhi/JNd4VR1bxi9vgSc1Cac1CYsnjiEhjmQZk+K2TzBP9B8WhfjF6kWMqrRVbhDKZgnE5A5PuDO0DI0rlU4/BvocMZAakYyzLrhvyHsrmheUWcoqRpdhet9Ci1Dy2i0RTA4/QmDgQ00WMOQPInA+modsqdhkAp7sqC8Py8LKNLMt1Z1hzAW/IImWwyS3jCu9Sxga3cPW7t7EPcEITYHIXkcgu11HBeUEyDn+1qzgML7QdriSUDronG9dwH1PSGIu4Po863D6ltHjYn6M8ZpyBwRGCZXQErNdBZwVEZtD7/7jKa+MMTmedQ+mkWNkQIA7AMQ6QOo0r1Blc6POmMADioOUqLbzgKOtPi2n89uosEaRo2JQrVhGiL9NGKJ78js7KGyy4cKtRdX1F6IHnhhn4mD8DQ5AJFO0d0eGopnS6g1zkL0MICr2jdYjH9DZucHyu9NoVw5AaHSjRtmClp3FISnzq1AGsZbBRofBv0J1OopiDR+uIMb+PlrH/sAwh+/QiAbg0DmgulFDKU3nSA8dS7EgmpnHhHZk7ftC7B61lCp8UKomsRlxTgE7S5cahvBxbZhdNpDaLTNgMVVJAvY8twZGQwGg1k2wGeetWRaBoKwTK1A0h2AUPkSZR1jqNd7YXBFIOmjQDjtGSZHfnAbmfwePuGbUudujUI7voT+AI3+wBq6xqI40+QA4cpSTI7sYHM2j2JtPinRSVnFGprFU6RZ3LtpwpXThCuXklMthz/Tv+g3HdPOfoYYAaMAAAAASUVORK5CYII=");
}
.icontextmenu:-moz-any([icon="blank"], [command="context-openlinkincurrent"]) {
list-style-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABEUlEQVQ4jZWTW27CQAxFTdfRSt0DiH0WIbFDEAGUMJN47LHp7UfDKDxSmiudv7lHskcm+s07Ec2JaPmCTyJ6oyeZi0hjZhd3xzNEBKvV6mtMsjSzS9u26LqucD6fUdc19vs93B273Q7r9fpBMiOipbsjpQRVRUoJKSXEGNE0DaqqgruDmdG2LTabzVVyK1DVQkoJzIwQAg6Hw8NI/U5mNwIzKw/MDCJSRjkej6iqCtvtdlxwz1ASQkBd1zidTv8XDCXMjBgjQgjTBO6OnDNUFcwMZp4uMLOyXBH5n8DMCjln5JwhItMF1/KQSb/wjDHB9197uOPSC0oWqtq5++gxDcuqGvvrLfkgogW9Pucr875DP1s1i/OTwNbrAAAAAElFTkSuQmCC");
}
.icontextmenu:-moz-any([icon="app"], [command="context-openlink"]) {
list-style-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACIUlEQVQ4jaXRzUtUURjH8fNfzOxaumnRIgf6EyRIcVGI1GiT1Tg0mYwwjghSYjajE6KFYiImKdlmBi0cLQwhsBd6sTGstFWkqKXdebn3zrnnfltcNVtl9oPf5iw+POd5hPjflAZHA7HEcjYyskTjvSUahz8RHlqkYXCB0ECa+jvzXOl7w+Xe1wRvvSTQ/Zxw32y2NDgaEEIIcW1sWXVNrvKvDcafKiGEEJGRJQ7SmugMQgghGoc/c5CcbXvsAOG7HwEwpYUhLXRTktUlml5gK2fyPaOztplnZT3H17UMX1Y0ALytqW1gaBGAglIULAtTWuQLkpzhQD/zkh9Zg3VNZ21LZ3UjD8DplkcO0DC4AIClFFIpCkphWha6tMiZkqwhyegSLSfZzBTY0AwAKpsnHCA0kHYA20YqtQuZSmFYzpd2IG0bAqhoSjpAff+7XWCncs80hlKYUjIx94BQr5eazhNU3SihLFznAMHbrxwAUHsgadvOXpQi8WyElrEqxtM9vP2WIj7l52T8MMW17g5xqfvF7mnsbUTtmcaybaqjJSTe3yTxoQuA2PQ54tPn8fjdugh0zf315scjR3iY7v/jLTnfg6fWjSirG71/oXOWmugMvutPqGqd4szVSSqbx6loSnIqkuBY4BDRVDVtKS8AbZPe3xPsJ0cvulrLY0V0pHwk53voSPkojxU5O9hviv2udo/fpXlq3Xj8Lq3Y72oXQohfrdS0QnwwoU4AAAAASUVORK5CYII=");
}
.icontextmenu:-moz-any([icon="jpg"], [command="context-viewimage"]) {
list-style-image: url("moz-icon://.jpg?size=16");
}
.icontextmenu:-moz-any([icon="images"], [command="context-copyimage-contents"]) {
list-style-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACUElEQVQ4jYWS30tTcQDF909Fc2+OO0tjDmE1K4pELzrmnG7DMExnLyNDV/RjD1mhY/vu3g0jsojCJ9+CHqLIl3FJ6+pt3m3f+73rfkfkTg9O3arhgc/r4cPh2C5OZRd8k5ImBAi1iw0Gj3H6Ce0NZxK2drlwXf5RUJQ6M02YVQ5W5SixGvZYDXuMQysb6A5JlbYFQoBQg5nw3uxB5PHIEcO3F+CbXIEnmkfHEKm3NXOIhJpVjkjSj6X3C3jyIYFnH+/hSiyLgqLgRDOHSKhR5Zh6GsLy5/tY+XRATzgDg5nYCEbxNZ445s4DvLkxi6LBIQRkanOIhJYYR8+8gKvJOPqnUzgznkKHSCAE83CKGbhGsnCNSHCHJCw9eo3tRBJapVFgFwnVDY5ziS70z6RO1PZGc9hOJLFbsSAEJGo7PZimOuXoCJyCa2wZBjNxOfYQs+m3R9wi7zA0u4iiweEJEnwRr2Gn1CiwD6apTi1savsQgnmYVY5Y6hXyBYbnyk+82PqFl99+Iy6vQ6tweMayUIYHoB4WdI2SraJeBmUcXcE8jCpHXF7HmlrH2vf9I+LyOnYrFtyjaaxd8kHVLTj9ErX1RbLz7nF5QwhI1DFE6iXGcX4mjbCkICwpmMgUMJEpwDudwk7Jgjuyik1tH6rODwqaczioby6HaF5twTeXg1qy0BtdRZnVUCwb6A7JrQ89HLRzIAbfXK6FzoEYVN1Cp1+qO/0SPRuSaN9E9m6rQdOgm1r9L9poN6d5UGrWUDFrKDPeoI12c5oHdfr/5X/afwDntYTcCZeBqgAAAABJRU5ErkJggg==");
}
.icontextmenu:-moz-any([icon="back"], [command="context-back"]) {
list-style-image: url("chrome://browser/skin/Toolbar.png"); -moz-image-region: rect(0, 18px, 18px, 0);
}
.icontextmenu:-moz-any([icon="forward"], [command="context-forward"]) {
list-style-image: url("chrome://browser/skin/Toolbar.png"); -moz-image-region: rect(0, 36px, 18px, 18px);
}
.icontextmenu:-moz-any([icon="stop"], [command="context-stop"]) {
list-style-image: url("chrome://browser/skin/Toolbar.png"); -moz-image-region: rect(0, 54px, 18px, 36px);
}
.icontextmenu:-moz-any([icon="reload"], [command="context-reload"]) {
list-style-image: url("chrome://browser/skin/Toolbar.png"); -moz-image-region: rect(0, 72px, 18px, 54px);
}
.icontextmenu:-moz-any([icon="home"], [command="Browser:Home"]) {
list-style-image: url("chrome://browser/skin/Toolbar.png"); -moz-image-region: rect(0, 90px, 18px, 72px);
}
.icontextmenu:-moz-any([icon="download"]) {
list-style-image: url("chrome://browser/skin/Toolbar.png"); -moz-image-region: rect(0, 108px, 18px, 90px);
}
.icontextmenu:-moz-any([icon="history"]) {
list-style-image: url("chrome://browser/skin/Toolbar.png"); -moz-image-region: rect(0, 126px, 18px, 108px);
}
.icontextmenu:-moz-any([icon="bookmark"]) {
list-style-image: url("chrome://browser/skin/Toolbar.png"); -moz-image-region: rect(0, 144px, 18px, 126px);
}
.icontextmenu:-moz-any([icon="print"]) {
list-style-image: url("chrome://browser/skin/Toolbar.png"); -moz-image-region: rect(0, 162px, 18px, 144px);
}
.icontextmenu:-moz-any([icon="newtab"], [command="context-openlinkintab"]) {
list-style-image: url("chrome://browser/skin/Toolbar.png"); -moz-image-region: rect(0, 180px, 18px, 162px);
}
.icontextmenu:-moz-any([icon="newwindow"]) {
list-style-image: url("chrome://browser/skin/Toolbar.png"); -moz-image-region: rect(0, 198px, 18px, 180px);
}
.icontextmenu:-moz-any([icon="copy2"]) {
list-style-image: url("chrome://browser/skin/Toolbar.png"); -moz-image-region: rect(0, 234px, 18px, 216px);
}
.icontextmenu:-moz-any([icon="paste"]) {
list-style-image: url("chrome://browser/skin/Toolbar.png"); -moz-image-region: rect(0, 252px, 18px, 234px);
}
.icontextmenu:-moz-any([icon="fullscreen"]) {
list-style-image: url("chrome://browser/skin/Toolbar.png"); -moz-image-region: rect(0, 270px, 18px, 252px);
}
.icontextmenu:-moz-any([icon="zoomout"], [icon="plus"]) {
list-style-image: url("chrome://browser/skin/Toolbar.png"); -moz-image-region: rect(0, 288px, 18px, 270px);
}
.icontextmenu:-moz-any([icon="zoomin"], [icon="minus"]) {
list-style-image: url("chrome://browser/skin/Toolbar.png"); -moz-image-region: rect(0, 306px, 18px, 288px);
}
.icontextmenu:-moz-any([icon="sync"]) {
list-style-image: url("chrome://browser/skin/Toolbar.png"); -moz-image-region: rect(0, 324px, 18px, 306px);
}
.icontextmenu:-moz-any([icon="feed"]) {
list-style-image: url("chrome://browser/skin/Toolbar.png"); -moz-image-region: rect(0, 342px, 18px, 324px);
}
.icontextmenu:-moz-any([icon="feedorange"]) {
list-style-image: url("chrome://browser/skin/feeds/feedIcon16.png");
}
.icontextmenu:-moz-any([icon="search"], [command="context-searchselect"]) {
list-style-image: url("chrome://global/skin/icons/Search-glass.png");
-moz-image-region: rect(0px, 16px, 16px, 0px);
}
.icontextmenu:-moz-any([icon="starbutton"]) {
list-style-image: none;
}
.icontextmenu:-moz-any([icon="starbutton"]) > hbox > .menu-iconic-icon {
background: transparent no-repeat center center -moz-element(#star-button);
}
]]>.toString());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.