Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,393 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

スクリプトファイルの探し方:
https://github.com/alice0775/userChrome.js を開いて[Go to file]をクリック, 左のテキスト入力欄に探したいスクリプトのファイル名を入力, リスト内の該当するものをクリック
  ディレクトリ番号が大きいものほど新しく/更新されたスクリプト
  FirefoxのバージョンNoより大きいディレクトリ番号内のスクリプトはそのバージョンでは動かない
  FirefoxのバージョンNoより小さいディレクトリ番号内のスクリプトは動くかも知れない

スクリプトの保存方法:
スクリプト名をクリック、[RAW]ボタンをクリック、名前を付けて保存
ファイルはUTF-8のBOMなしで保存

==================
userchrome.jsのインストール方法 方法 その1:
1. アプリケーションインストールフォルダ(例えば, %ProgramFiles%\Mozilla Firefox)直下に以下のファイルを保存する
147/install_folder/config.js, 155/install_folder/config.js


2. アプリケーションインストールフォルダ\defaults\pref 直下に以下のファイルを保存する
147/install_folder\defaults\pref\config-prefs.js, 155以上は 155/install_folder\defaults\pref\config-prefs.js


3. プロファイルフォルダ(例えば, %APPDATA%\Mozilla\Firefox\Profiles\hogehoge.default)直下に chrome フォルダを作り以下のファイルを保存する
150/userChrome.js, 155以上は 155/userChrome.js


4. 必要なスクリプトファイルを保存する

5. 念のため 一回 %ProgramFiles%\Mozilla Firefox\firefox.exe -purgecaches オプション付きで起動する




==================
userchrome.jsのインストール方法 方法 その2(https://github.com/xiaoxiaoflood/firefox-scripts):
136以上はhttps://github.com/xiaoxiaoflood/firefox-scripts/issues/343も参照

最近は更新されてないので削除



==================
userchrome.jsのインストール方法 方法 その3(https://bitbucket.org/BSTweaker/userchromejs/src/master/loader/):

1. config.jsが動くようにしておく (例えば その1の1. 2. )

2. https://bitbucket.org/BSTweaker/userchromejs/src/master/loader/ 
   上記に従いconfig.jsコードを修正

3. chromeフォルダに以下のファイルを保存
   https://bitbucket.org/BSTweaker/userchromejs/src/master/loader/UserChromeJSLoader.mjs

4. 必要に応じ、スクリプトの読み込み順番(大小文字を区別しない)に並び変えるため, およびスクリプトの有効無効を中クリックで行えるようにしかつメニューを閉じないように

--- org/UserChromeJSLoader.mjs	2025-05-20 13:28:55.155740200 +0900
+++ UserChromeJSLoader.mjs	2025-05-20 13:29:15.960386900 +0900
@@ -1,17 +1,18 @@
 const ucjsLoaderConfig = {
     /* chrome以下にある.uc.jsが置いてあるフォルダを列挙する "."はchromeフォルダ直下を指す */
     subScriptFolders   : [".", "SubScript"],
     /* trueにするとスクリプトをファイル名の辞書順で読み込む */
     loadScriptsInOrder : true,
+    loadScriptsInOrderIgnoreCase : true,
     /* chrome直下に保存される設定ファイル名 */
     configFileName     : "UserChromeJSLoader.config.json",
     /* スクリプトの編集 (メニュー右クリック) に使うエディタのパス */
     editorPath         : "",
 };
 
 const mainChromeWindowURL = "chrome://browser/content/browser.xhtml";
 const chromeDir = PathUtils.join(PathUtils.profileDir, "chrome");
 const baseResourceURI = Components.stack.filename.slice(0, Components.stack.filename.lastIndexOf("/"));
 const lazy = {};
 ChromeUtils.defineESModuleGetters(lazy, {
     setTimeout: "resource://gre/modules/Timer.sys.mjs",
@@ -186,19 +187,25 @@
         this.scriptDirs = dirs;
         this.scripts = [];
         this.disabledScripts = null;
         this.groupedScripts = new Map();
         this.config = new Config(PathUtils.join(chromeDir, ucjsLoaderConfig.configFileName));
         this.isReady = this.load();
     }
     get sortedScripts() {
+      if (ucjsLoaderConfig.loadScriptsInOrderIgnoreCase) {
+        return this.scripts.sort((a, b) => {
+            return a.path.toLowerCase() > b.path.toLowerCase() ? 1 : -1;
+        });
+      } else {
         return this.scripts.sort((a, b) => {
             return a.path > b.path ? 1 : -1;
         });
+      }
     }
     load() {
         return new Promise(resolve => {
             let newScripts = [];
             let existingScripts = [];
             let promises = [];
             let start = Date.now();
             for (let dir of this.scriptDirs) {
@@ -307,16 +314,28 @@
         });
         toolsMenu.querySelector("#UCJSLoader-sandboxed")?.addEventListener("command", event => {
             let enabled = !!scriptLibrary.config.get("force_sandbox");
             scriptLibrary.config.set("force_sandbox", !enabled);
         });
         toolsMenu.querySelector("#UCJSLoader-open-folder")?.addEventListener("command", event => {
             Services.dirsvc.get("UChrm", Ci.nsIFile).launch();
         });
+        win.document.getElementById("UCJSLoader-menu").addEventListener("mouseup", event => {
+      		const menuitem = event.target;
+      		if (event.button == 1) 
+      		{
+      			menuitem.setAttribute('closemenu', 'none');
+      			menuitem.parentNode.addEventListener('popuphidden', () => {
+      				menuitem.removeAttribute('closemenu');
+      			}, { once: true });
+      			if (event.ctrlKey)
+      		  	menuitem.parentNode.hidePopup();
+      		}
+		    });
         toolsMenu.addEventListener("popupshowing", event => {
             if (event.target !== toolsMenu) return;
             let parentMenu = win.document.getElementById("UCJSLoader-menu");
             let target = parentMenu.querySelector("#UCJSLoader-submenu-0");
             while (target) {
                 let tmp = target.nextElementSibling;
                 target.remove();
                 target = tmp;
@@ -332,17 +351,17 @@
                 let submenu = parentMenu.querySelector(`#UCJSLoader-submenu-${n++} menupopup`);
                 for (let script of value) {
                     let item = win.document.createXULElement("menuitem");
                     item.setAttribute("label", script.filename);
                     item.setAttribute("type", "checkbox");
                     item.setAttribute("checked", !script.disabled);
                     let callback = event => {
                         /* only command event is fired for right-click on macOS */
-                        if (event.type === "command" && event.button === 0) script.disabled = !script.disabled;
+                        if (event.type === "command" && event.button <= 1) script.disabled = !script.disabled;
                         else if (event.button === 2) script.edit();
                     };
                     item.addEventListener("command", callback, {once: true});
                     item.addEventListener("click", callback, {once: true});
                     submenu.appendChild(item);
                 }
             }
             toolsMenu.querySelector("#UCJSLoader-enabled")?.setAttribute("checked", !scriptLibrary.config.get("disabled"));
@@ -353,19 +372,22 @@
     }
     getSandboxFor(win) {
         let sb = new Cu.Sandbox(win, {
             sandboxPrototype: win,
             sameZoneAs: win,
         });
         /* toSource() is not available in sandbox */
         Cu.evalInSandbox(`
-            Object.defineProperty(Function.prototype, "toSource", {value: window.Function.prototype.toSource});
-            Object.defineProperty(Object.prototype, "toSource", {value: window.Object.prototype.toSource});
-            Object.defineProperty(Array.prototype, "toSource", {value: window.Array.prototype.toSource});
+            Function.prototype.toSource = window.Function.prototype.toSource;
+            Object.defineProperty(Function.prototype, "toSource", {enumerable : false})
+            Object.prototype.toSource = window.Object.prototype.toSource;
+            Object.defineProperty(Object.prototype, "toSource", {enumerable : false})
+            Array.prototype.toSource = window.Array.prototype.toSource;
+            Object.defineProperty(Array.prototype, "toSource", {enumerable : false})
         `, sb);
         win.addEventListener("unload", () => {
             lazy.setTimeout(() => {
                 Cu.nukeSandbox(sb);
             }, 0);
         }, {once: true});
         return sb;
     }


5. 必要なスクリプトファイルを保存する


6. 念のため 一回 %ProgramFiles%\Mozilla Firefox\firefox.exe -purgecaches オプション付きで起動する




==================
userchrome.jsのインストール方法 方法 その4(https://github.com/onemen/TabMixPlus/tree/main?tab=readme-ov-file):

1. アプリケーションインストールフォルダ(例えば, %ProgramFiles%\Mozilla Firefox)直下に以下のファイルを解凍保存する
  https://github.com/onemen/TabMixPlus/releases/download/dev-build/fx-folder.zip

2, プロファイルフォルダ(例えば, %APPDATA%\Mozilla\Firefox\Profiles\hogehoge.default)直下に chrome フォルダを作り以下のファイルをダウンロードし解凍保存する
  https://github.com/onemen/TabMixPlus/releases/download/dev-build/utils.zip


3. Firefoxのsandbox対応と初期化中にスクリプトが実行されないように及び日本語ファイル名対応にするため,展開保存した utils\userChrome.js を修正

--- org/userChrome.js	2025-11-30 05:51:26.000000000 +0900
+++ userChrome.js	2026-01-10 14:11:25.704357600 +0900
@@ -1,14 +1,15 @@
 'use strict';
 
 ChromeUtils.defineESModuleGetters(this, {
   xPref: 'chrome://userchromejs/content/xPref.sys.mjs',
   Management: 'resource://gre/modules/Extension.sys.mjs',
   AppConstants: 'resource://gre/modules/AppConstants.sys.mjs',
+  setTimeout: "resource://gre/modules/Timer.sys.mjs",
 });
 
 let UC = {
   webExts: new Map(),
   sidebar: new Map(),
   sandboxes: new WeakMap()
 };
 
@@ -54,17 +55,21 @@
 
     let def = ['', ''];
     let author = (header.match(/\/\/ @author\s+(.+)\s*$/im) || def)[1];
     let filename = aFile.leafName || '';
 
     return this.scripts[filename] = {
       filename: filename,
       file: aFile,
-      url: Services.io.getProtocolHandler('file').QueryInterface(Ci.nsIFileProtocolHandler).getURLSpecFromDir(this.chromedir) + filename,
+      url:
+        Services.io
+          .getProtocolHandler('file')
+          .QueryInterface(Ci.nsIFileProtocolHandler)
+          .getURLSpecFromActualFile(aFile) /*.getURLSpecFromDir(this.chromedir) + filename*/ ,
       name: (header.match(/\/\/ @name\s+(.+)\s*$/im) || def)[1],
       description: (header.match(/\/\/ @description\s+(.+)\s*$/im) || def)[1],
       version: (header.match(/\/\/ @version\s+(.+)\s*$/im) || def)[1],
       author: (header.match(/\/\/ @author\s+(.+)\s*$/im) || def)[1],
       regex: new RegExp('^' + exclude + '(' + (rex.include.join('|') || '.*') + ')$', 'i'),
       id: (header.match(/\/\/ @id\s+(.+)\s*$/im) || ['', filename.split('.uc.js')[0] + '@' + (author || 'userChromeJS')])[1],
       homepageURL: (header.match(/\/\/ @homepageURL\s+(.+)\s*$/im) || def)[1],
       downloadURL: (header.match(/\/\/ @downloadURL\s+(.+)\s*$/im) || def)[1],
@@ -107,18 +112,20 @@
     if (script.onlyonce && script.isRunning) {
       if (script.startup) {
         Cu.evalInSandbox(`(function(script, win){${script.startup}})`, this.getSandbox(win))(script, win);
       }
       return;
     }
 
     try {
-      Services.scriptloader.loadSubScript(script.url + '?' + script.file.lastModifiedTime,
-                                          script.onlyonce ? { window: win } : win);
+      let timer = setTimeout(() => {
+            Services.scriptloader.loadSubScript(script.url + '?' + script.file.lastModifiedTime,
+                                                script.onlyonce ? { window: win } : win);
+      }, 0);
       script.isRunning = true;
       if (script.startup) {
         Cu.evalInSandbox(`(function(script, win){${script.startup}})`, this.getSandbox(win))(script, win);
       }
       if (!script.shutdown) {
         this.everLoaded.push(script.id);
       }
     } catch (ex) {
@@ -190,20 +197,20 @@
   xPref.set(_uc.PREF_SCRIPTSDISABLED, '', true);
 }
 
 let UserChrome_js = {
   observe: function (aSubject) {
     if (aSubject.document.isUncommittedInitialDocument) {
       const parent = aSubject.parent;
       aSubject.addEventListener("DOMContentLoaded", () => {
-        parent.addEventListener("DOMContentLoaded", this, {once: true, capture: true})
+        parent.addEventListener("load", this, {once: true, capture: true})
       }, {once:true})
     } else {
-      aSubject.addEventListener('DOMContentLoaded', this, {once: true, capture: true});
+      aSubject.addEventListener('load', this, {once: true, capture: true});
     }
   },
 
   handleEvent: function (aEvent) {
     let document = aEvent.target;
     let window = document.defaultView;
     this.load(window);
   },
@@ -255,10 +262,10 @@
   _uc.chromedir.append(_uc.scriptsDir);
   _uc.getScripts();
   let windows = Services.wm.getEnumerator(null);
   while (windows.hasMoreElements()) {
     let win = windows.getNext();
     if (!('UC' in win))
       UserChrome_js.load(win)
   }
-  Services.obs.addObserver(UserChrome_js, 'domwindowopened', false);
+  Services.obs.addObserver(UserChrome_js, 'chrome-document-global-created', false);
 }


4. 必要なスクリプトファイルを保存する


5. https://raw.githubusercontent.com/xiaoxiaoflood/firefox-scripts/master/chrome/rebuild_userChrome.uc.js を使う場合は、日本語スクリプト名およびインラインイベントおよびBug 2008041に対応するため,以下の修正が要る。

--- org/rebuild_userChrome.uc.js	2026-01-10 14:39:15.566706800 +0900
+++ rebuild_userChrome.uc.js	2026-01-10 14:41:30.101447300 +0900
@@ -22,38 +22,43 @@
     while (document.getElementById('uc-menuseparator').nextSibling) {
       document.getElementById('uc-menuseparator').nextSibling.remove();
     }
 
     let enabled = xPref.get(_uc.PREF_ENABLED);
 
     let mi = event.target.appendChild(this.elBuilder(document, 'menuitem', {
       label: enabled ? 'Enabled' : 'Disabled (click to Enable)',
-      oncommand: 'xPref.set(_uc.PREF_ENABLED, ' + !enabled + ');',
+      //oncommand: 'xPref.set(_uc.PREF_ENABLED, ' + !enabled + ');',
       type: 'checkbox',
-      checked: enabled
+      //checked: enabled
     }));
+    mi.toggleAttribute("checked", enabled);
+    mi.addEventListener("command", (event) => xPref.set(_uc.PREF_ENABLED, !enabled ));
 
     if (Object.keys(_uc.scripts).length > 1)
       event.target.appendChild(this.elBuilder(document, 'menuseparator'));
 
     Object.values(_uc.scripts).sort((a, b) => a.name.localeCompare(b.name)).forEach(script => {
       if (script.filename === _uc.ALWAYSEXECUTE) {
         return;
       }
 
       mi = event.target.appendChild(this.elBuilder(document, 'menuitem', {
         label: script.name ? script.name : script.filename,
-        onclick: 'UC.rebuild.clickScriptMenu(event)',
-        onmouseup: 'UC.rebuild.shouldPreventHide(event)',
+        //onclick: 'UC.rebuild.clickScriptMenu(event)',
+        //onmouseup: 'UC.rebuild.shouldPreventHide(event)',
         type: 'checkbox',
-        checked: script.isEnabled,
+        //checked: script.isEnabled,
         class: 'userChromejs_script',
         restartless: !!script.shutdown
       }));
+      mi.toggleAttribute("checked", script.isEnabled);
+      mi.addEventListener("click", (event) => UC.rebuild.clickScriptMenu(event));
+      mi.addEventListener("mouseup", (event) => UC.rebuild.shouldPreventHide(event));
       mi.filename = script.filename;
       let homepage = script.homepageURL || script.downloadURL || script.updateURL || script.reviewURL;
       if (homepage)
         mi.setAttribute('homeURL', homepage);
       mi.setAttribute('tooltiptext', `
         Left-Click: Enable/Disable
         Middle-Click: Enable/Disable and keep this menu open
         Right-Click: Edit
@@ -66,34 +71,34 @@
       event.target.appendChild(mi);
     });
 
     document.getElementById('showToolsMenu').setAttribute('label', 'Switch to ' + (this.showToolButton ? 'button in Navigation Bar' : 'item in Tools Menu'));
   },
 
   onHamPopup: function (aEvent) {
     const enabledMenuItem = aEvent.target.querySelector('#appMenu-userChromeJS-enabled');
-    enabledMenuItem.checked = xPref.get(_uc.PREF_ENABLED);
+    enabledMenuItem.toggleAttribute("checked", xPref.get(_uc.PREF_ENABLED));
 
     // Clear existing scripts menu entries
     const scriptsSeparator = aEvent.target.querySelector('#appMenu-userChromeJS-scriptsSeparator');
     while (scriptsSeparator.nextSibling) {
       scriptsSeparator.nextSibling.remove();
     }
 
     // Populate with new entries
     let scriptMenuItems = [];
     Object.values(_uc.scripts).sort((a, b) => a.name.localeCompare(b.name)).forEach(script => {
       if (_uc.ALWAYSEXECUTE.includes(script.filename))
         return;
 
       let scriptMenuItem = UC.rebuild.createMenuItem(scriptsSeparator.ownerDocument, null, null, script.name ? script.name : script.filename);
       scriptMenuItem.setAttribute('onclick', 'UC.rebuild.clickScriptMenu(event)');
       scriptMenuItem.type = 'checkbox';
-      scriptMenuItem.checked = script.isEnabled;
+      scriptMenuItem.toggleAttribute("checked", script.isEnabled);
       scriptMenuItem.setAttribute('restartless', !!script.shutdown);
       scriptMenuItem.filename = script.filename;
       let homepage = script.homepageURL || script.downloadURL || script.updateURL || script.reviewURL;
       if (homepage)
         scriptMenuItem.setAttribute('homeURL', homepage);
       scriptMenuItem.setAttribute('tooltiptext', `
         Left-Click: Enable/Disable
         Middle-Click: Enable/Disable and keep this menu open
@@ -123,17 +128,17 @@
         if (event.ctrlKey) {
           let url = target.getAttribute('homeURL');
           if (url) {
             gBrowser.addTab(url, { triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({}) });
           }
         } else {
           this.toggleScript(script);
           if (target.tagName === 'toolbarbutton')
-            target.setAttribute('checked', script.isEnabled);
+            target.toggleAttribute('checked', script.isEnabled);
         }
         break;
       case 2:
         if (event.ctrlKey)
           this.uninstall(script);
         else
           this.launchEditor(script);
     }
@@ -166,23 +171,25 @@
       let editorArgs = [];
       let args = Services.prefs.getCharPref('view_source.editor.args');
       if (args) {
         const argumentRE = /"([^"]+)"|(\S+)/g;
         while (argumentRE.test(args)) {
           editorArgs.push(RegExp.$1 || RegExp.$2);
         }
       }
-      editorArgs.push(script.file.path);
+      //editorArgs.push(script.file.path);
+      editorArgs.push(Services.io.newURI(script.url)
+                 .QueryInterface(Ci.nsIFileURL).file.path);
       try {
         let appfile = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile);
         appfile.initWithPath(editor);
         let process = Cc['@mozilla.org/process/util;1'].createInstance(Ci.nsIProcess);
         process.init(appfile);
-        process.run(false, editorArgs, editorArgs.length, {});
+        process.runw(false, editorArgs, editorArgs.length, {});
       } catch {
         alert('Can\'t open the editor. Go to about:config and set editor\'s path in view_source.editor.path.');
       }
     }
   },
 
   restart: function () {
     Services.appinfo.invalidateCachesOnRestart();
@@ -232,18 +239,20 @@
 
   createMenuItem: function (doc, id, icon, label, command) {
     const menuItem = doc.createXULElement('toolbarbutton');
     menuItem.className = 'subviewbutton subviewbutton-iconic';
     if (id)
       menuItem.id = 'appMenu-userChromeJS-' + id;
     menuItem.label = label;
     menuItem.style.listStyleImage = icon;
-    if (command)
-      menuItem.setAttribute('oncommand', command);
+    if (command) {
+      //menuItem.setAttribute('oncommand', command);
+      menuItem.addEventListener('command', (e) => command(e));
+    }
     return menuItem;
   },
 
   install: function (script) {
     script = _uc.getScriptData(script.file);
     Services.obs.notifyObservers(null, 'startupcache-invalidate');
     _uc.windows((doc, win, loc) => {
       if (win._uc && script.regex.test(loc.href)) {
@@ -304,17 +313,17 @@
           padding-inline-start: 12px;
         }
 
         #userChromejs_restartApp > .menu-accel-container {
           display: none;
         }
 
         /* bug 1828413: checkbox is only rendering on mouseover/mouseout */
-        menuitem[type="checkbox"][checked="true"] .menu-iconic-icon {
+        menuitem[type="checkbox"][checked] .menu-iconic-icon {
           appearance: checkbox !important;
         }
 
         @media (-moz-platform: windows) {
           #userChromejs_openChromeFolder {
             padding-block: 0.5em;
           }
           #userChromejs_restartApp {
@@ -380,61 +389,66 @@
       tooltiptext: 'userChromeJS Manager',
       type: 'menu',
       class: 'toolbarbutton-1 chromeclass-toolbar-additional',
       style: 'list-style-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABeSURBVDhPY6AKSCms+x+SkPMfREOFwACXOAYYNQBVITrGJQ7CUO0IA0jFUO0QA3BhkEJs4iAM1Y4bgBTBDIAKkQYGlwHYMFQZbgBSBDIAF4Yqww3QbUTHUGWUAAYGAEyi7ERKirMnAAAAAElFTkSuQmCC)',
     });
 
     let mp = UC.rebuild.elBuilder(aDocument, 'menupopup', {
       id: 'userChromejs_options',
-      onpopupshowing: 'UC.rebuild.onpopup(event);',
-      oncontextmenu: 'event.preventDefault();'
+      //onpopupshowing: 'UC.rebuild.onpopup(event);',
+      //oncontextmenu: 'event.preventDefault();'
     });
     toolbaritem.appendChild(mp);
+    mp.addEventListener('popupshowing', (event) => UC.rebuild.onpopup(event));
+    mp.addEventListener('contextmenu', (event) => event.preventDefault());
 
     let mg = mp.appendChild(aDocument.createXULElement('menugroup'));
     mg.setAttribute('id', 'uc-menugroup');
 
     let mi1 = UC.rebuild.elBuilder(aDocument, 'menuitem', {
       id: 'userChromejs_openChromeFolder',
       label: 'Open chrome directory',
       class: 'menuitem-iconic',
       flex: '1',
       style: 'list-style-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABe0lEQVQ4jc3N2ytDARwH8J83/wRKefU3zFBCSnlQSnkQpSiFFLk8OMQmxLBZLos2I7ckM3PmMmEredF23Ma2GrPjkuFsvh7mstTqnDff+jx+v1+ifxEZ43zPYFyIld3FHWYxzlRRA5mdXFi3c4vpvbuo3TvU6z2CnHEKf4djRd9bLYnyDldkYtuPqZ1b0TIYF2StlkTK6eaQ080ht+eLgkPeH/nflGc/8hRRVNB7BuVaAGPWILRsDCsfl4bl0bMaQGHfOaho4AL9pns0GPyo04vTYPCjz3SP4sELUInqEkObPNoXA5IMmoMoHbkClWncUG8/QLnOS6K2PqJc6wZVjl9jyvYMtfVJEp3tGVWTN6Bq3Q2M9hBmDl4kMTpCqJ32gOr1XmHp+BUrJ2+SLB2/onHWK1DLvG95lOU/Nk4FbLnCcbHcL/OpgFGWj7Qt+AxUo7an12qOHM1Gb6R5zgcxmozecLVq31YxvJ9GRJRARElElExEKSIlf3USPgHT/mSv7iPTOwAAAABJRU5ErkJggg==)',
-      oncommand: 'Services.dirsvc.get(\'UChrm\', Ci.nsIFile).launch();'
+      //oncommand: 'Services.dirsvc.get(\'UChrm\', Ci.nsIFile).launch();'
     });
     mg.appendChild(mi1);
-
+    mi1.addEventListener('command', () => Services.dirsvc.get('UChrm', Ci.nsIFile).launch());
+    
     let tb = UC.rebuild.elBuilder(aDocument, 'menuitem', {
       id: 'userChromejs_restartApp',
       class: 'menuitem-iconic',
       tooltiptext: 'Restart ' + _uc.BROWSERNAME,
       style: 'list-style-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB20lEQVQ4jY2Tv2sUURDHZ/bX7eW0ChJBRFKIRRCRIEHuzVvfrYmkSiFXSSoLERERy5B/wcIuqG9mN5VecUWwCqkOEQsLKysLsQgSxEJEgsVYeJfsHXuY4tvN9zMzzHxBVXFS8Gy1kRaZi8U+iCV7HIq73Xqez9XWThoDsRvg6QDY6Ji8+RMK9dLSztcCoMhnkc27YxPth0I7oVAPhT5WYD9ScfkYALYWYxQa/OvU/h5ztg5bi3G1U2vbXUFPb4fT/EzELRwBYraPRvSE7eW6XVUV4en1JjLtARtFoYGqInRfd0Nk8wXYaCzZ/WnmkZrengc2v4GNNr1bglPiFoaj/5orV1r/A6gqhkI9YKMB0yY0OF9GsV/jIts9iVlVMeJscwhgOKmpqoDpGNDg5YuB0HYg9lUotINCuxFn/bN+9czUFZj6wEYDsRsQle7W+NPQ/uhEdUpLOw/cPgQ2OlPcvAoJZ90qICnc2tQzlist9GYAbDRk2lNVhFDs3YmXPUjkxp3JR2qWbgk9fRj9S+Olu6SqCJHYJ+DN5xnOryHT+wrsG7J9g0x9ZPup2iAS1z6aKi076+mLzoVRmKJpYeL2YSC2aBadc1PTOB7n3AXe3guYHiberZ0u8tm62r99Gyd0lo7sIAAAAABJRU5ErkJggg==)',
-      oncommand: 'UC.rebuild.restart();'
+      //oncommand: 'UC.rebuild.restart();'
     });
     mg.appendChild(tb);
+    tb.addEventListener('command', () => UC.rebuild.restart());
 
     let mn = UC.rebuild.elBuilder(aDocument, 'menu', {
       id: 'uc-manageMenu',
       label: 'Settings',
       class: 'menuitem-iconic',
       style: 'list-style-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAADJUlEQVQ4ja1TS0wTQRgean0/ovFgTDxpjDc9Gg8mvSrnKhFSC8VpCuyyu22Xbdm2s7Rdt48t7kIhEJEIYiKKphZK0CoRLVYlHiAEFYMng4+bF6nUjgfbuiocTPwuM5P83/d/8z8AWAMIIX3xWvHHCYxG44a1OOuCIIhd2rfZbN7yTwIURe0+D8lAbSO3aLI21xgMBn2dzXbQZLM/MNkcEwRNnyw6rFhTAEK4ESGkc/L8IacgY1Hpw1xbbLWBFT5QrRe/+GM92Bfpxg4Xkotf3LSuGAAA1DcypC/cnWuL9a5yQQXzUifmApewR4pjUenLESzKQAi3rUmmaXqrpYF0WBqYDrtXynnDceyR1JW7E5Opqcwz9Ul2pr+zb+gdF2jHnlAnvkC6piw2WmikHCeKEj+dmWDTuSZXEPsiXdgb6Sr4o/HlV4uLZ5LJZDnz0tLSkeE7YyMt/nbcFuvBrqCCqyGdhhBuLAtF2jvE1osd+UCsZ8Xhi3yfnMqYNYZ1pcB0Or1X6bm64BLVvCcczwflrrcsy+4sBVaMjo7u6R248ZDiJaz0Ds4PDAxs1woAAIDBYNADAMBIIsU6BRm7RWUlm31x+rduAQCAEFICDkEu+MTYuMZJGUajcQNCQBeU2ivZNrng8ssfNYNb7FQ9caCusSUrRLsLFtL9ppogdhUnuCxWSniursHnFtWCwyvlqmttNUA7U1bSeYnxSNgXin91CtFCdT1hLwkghPSltYAQ7rcy/LI3HM+7RaUAKfdnjuP2lB0NjyQq3X45R7eK2ImiuIkV8mdNVsZspnaXYqpq4XGzjXneIsjY7g1hkvPjvsHhm9o6AlVVN2ezL6oyz2fsATn+yemLYModxDWQfm2luAmTjXlsaXbnWvwxTPNS4XZy/Nrj6em6ZDJ57Lc50mJyKlNDugLfPJKaY4UovsB4MeEKYE+oI0/z4mr3laFUKpXa/BfxV3uRHgCg43n/YZITvtfTPEYh9f1Y+tGDy4M3X1oZTx4yXsyjYFhT/PV3DSG0Y3Z+oen6rcT92fn5Uwgh3dzc3L7xe5P9T57OXE4kEkfXJf8P/ABlOH7kn81/zwAAAABJRU5ErkJggg==)'
     });
     mp.appendChild(mn);
 
     let mp2 = mn.appendChild(aDocument.createXULElement('menupopup'));
 
     let mi2 = UC.rebuild.elBuilder(aDocument, 'menuitem', {
       id: 'showToolsMenu',
       label: 'Switch display mode',
       class: 'menuitem-iconic',
       style: 'list-style-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADdklEQVQ4jXWTbUwUdADG/7zccZ6lQ/pgcDJEEEGBO8/hmLQY9mKOmFvyEi93IIISSSMGxx0Hw0QKJJCOI3CxGM0IhEASjDsQ1lgdRuqcE4N0RznTjPFSDGJwvz64nOX6bc+35+XTI8R/KRXOG6LFwcAEj+7d2b4PI3L8ltQZiuuKaGmp5yER8JT/Sco/0e+JylP1xNfuXTrWEU/+BQ26Pi3vnk8ioyWG10pU9lj9S4VjY2Pyp4cbcxP36PyW83tTKBnMwDhwiCJrGkXWVIzWNIoH0ikezCTxTBRROcG9k5O2dY/Dp5qKwyN0W5aMgxkYLKkYrakYB7XorAnorPEUWOLJ749D159E6dBRIj7cRIhW8fmj5dJI16jc4L78vhQK+zUYrCkUDrxJtS0P6+12hu3dDNu7sNw+R8vVahK+2E1onQyvHOE4YIyIFOv3i7gEU+RyoUVD2dBbXL9v46tbLRiHkum8cYbv7SNcsdsA6L/RTVCVMzvNMkJq5GyMF50iMNnDktV2gNPfGrj3xxT/MDL1NcXDSRgGEzh+6TArLNM+2sy2SkFYgxxVnZwtWdK7Iizbe67hu3Lml2bAAQ6H43HJ+IOrvDeiRdunYmFllnOXWwioEuxqlKGskxGgk/4lIt7xX6keLsJ06QSnLAbG719jaXmJin4d+t5UDraGENOhYGFlnq4fWlHXyon6dCORTV5s1UkdQpn+/ERa66tkdu0jpTOcb36+yIO5GcJN7rzS5kHPZAe/LPzK7Moq9/6cY2LWzs2Htzjc+gbe2U4zwnO/c2XQcRlq81p2mASt45/x4+/TKKsk7GoW7DuroGein99WYRqYnJsn5eM4fIwueGucrojgrPW+vkekUyEmN7bXCppvtnFnEYoHijhxWU/yhRcIa1xLzWg9vT9d48X31XiXCALL3AjUuhcIIYSI0ccU+BgEwSZX3u49Qr2tjXrblzSMnueD4QZebtqGss4FZYUH/icFoSY5Co3T3cT6LHchhBCx5thnFAnSi0FlMnbUSgg46UxguQtBFS4EV7qhrn0WtXkNyjo3Qj+Ss/moZHF7uvvr//qC37EN6xSxLmf98iSOkBoZKvMadtY/ksosR2mSE1Qmw0cjsXunuUT/7yO9tK57vZMl7ZuzpHf8C6SLW/XSVf9cybRPquvopmRng2emeO5J/98W5fyDGAVpggAAAABJRU5ErkJggg==)',
-      oncommand: 'UC.rebuild.toggleUI();'
+      //oncommand: 'UC.rebuild.toggleUI();'
     });
     mp2.appendChild(mi2);
+    mi2.addEventListener('command', () => UC.rebuild.toggleUI());
 
     let sep = mp.appendChild(aDocument.createXULElement('menuseparator'));
     sep.setAttribute('id', 'uc-menuseparator');
 
     let mi = UC.rebuild.elBuilder(aDocument, 'menu', {
       id: 'userChromejs_Tools_Menu',
       label: 'userChromeJS Manager',
       tooltiptext: 'UC Script Manager',
@@ -476,17 +490,18 @@
       viewCache.appendChild(userChromeJsPanel);
 
       const scriptsButton = aDocument.createXULElement('toolbarbutton');
       scriptsButton.id = 'appMenu-userChromeJS-button';
       scriptsButton.className = 'subviewbutton subviewbutton-iconic subviewbutton-nav';
       scriptsButton.label = 'User Scripts';
       scriptsButton.style.listStyleImage = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABeSURBVDhPY6AKSCms+x+SkPMfREOFwACXOAYYNQBVITrGJQ7CUO0IA0jFUO0QA3BhkEJs4iAM1Y4bgBTBDIAKkQYGlwHYMFQZbgBSBDIAF4Yqww3QbUTHUGWUAAYGAEyi7ERKirMnAAAAAElFTkSuQmCC)';
       scriptsButton.setAttribute('closemenu', 'none');
-      scriptsButton.setAttribute('oncommand', 'PanelUI.showSubView(\'appMenu-userChromeJsView\', this)');
+      //scriptsButton.setAttribute('oncommand', 'PanelUI.showSubView(\'appMenu-userChromeJsView\', this)');
+      scriptsButton.addEventListener('command', () => PanelUI.showSubView('appMenu-userChromeJsView', this));
 
       const addonsButton = aDocument.getElementById('appMenu-extensions-themes-button') ?? aDocument.getElementById('appmenu_addons') ?? viewCache.querySelector('#appMenu-extensions-themes-button');
       addonsButton.parentElement.insertBefore(scriptsButton, addonsButton);
     }
   }
 }
 
 UC.rebuild.init();



6. 念のため 一回 %ProgramFiles%\Mozilla Firefox\firefox.exe -purgecaches オプション付きで起動する





* 「必要に応じ」はやらなくてもいいよ

DeepL.com(無料版)で翻訳しました。


免責事項
    一切の責任を負いません。
    自己の責任の上で使用して下さい。

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages