Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * 以下のコードを .keysnail.js 内の PRESERVE エリアへペーストすることで
- * 編集メニューと KeySnail のエクステに「userchrome.css を編集」が追加される
- */
- (function () {
- const MENU_ITEM_ID = "edit-userchrome-css";
- var description = M({ja: "userChrome.css を編集", en: "Edit userChrome.css"});
- var menu = document.getElementById("edit-menu");
- if (!menu)
- return;
- var item = document.getElementById(MENU_ITEM_ID);
- if (!item) {
- item = menu.appendItem(description);
- item.id = MENU_ITEM_ID;
- item.setAttribute("class", "menuitem-iconic");
- item.setAttribute("src", "chrome://keysnail/skin/icon/edit.png");
- }
- if (my.savedEditUserChromeCSS)
- item.removeEventListener("command", my.savedEditUserChromeCSS, false);
- my.savedEditUserChromeCSS = function () {
- var file = util.getSpecialDir("UChrm");
- file.append("userChrome.css");
- userscript.editFile(file.path);
- };
- ext.add("edit-userchrome-css", my.savedEditUserChromeCSS, description);
- item.addEventListener("command", my.savedEditUserChromeCSS, false);
- })();
Add Comment
Please, Sign In to add comment