Firefox userChrome.js greasemonkeyスクリプトスレ45 (533レス)
Firefox userChrome.js greasemonkeyスクリプトスレ45 http://egg.5ch.net/test/read.cgi/software/1741415944/
上
下
前次
1-
新
通常表示
512バイト分割
レス栞
抽出解除
レス栞
リロード規制
です。10分ほどで解除するので、
他のブラウザ
へ避難してください。
332: 名無しさん@お腹いっぱい。 [sage] 2025/04/30(水) 16:41:15.70 ID:/WTHNgn/0 138にしたらツールバーにボタンを追加するスクリプトが動かなくなったので AIに新規で作ってもらいました。シンプル構文ですぐ出来たんですが ツールバー内で位置固定だったため自由に動かせるようにしていうと 途端にエラーで動かなくなりました。10回以上試してもダメです chromeclass-toolbar-additional、 navBar.customizationTarget. 違いはこの2か所だけなんですけどそんな大きな障害になる部分なんでしょうか? nav-barの .customizationTarget が nullでそれを回避するみたいな事をずっと言ってました こちらは位置固定版(一部だけ抜粋です。ここ以外は全部同一) btn.setAttribute("class", "toolbarbutton-1"); // ツールバーの先頭に追加 navBar.insertBefore(btn, navBar.firstElementChild); こっちが位置変更可能版 btn.setAttribute("class", "toolbarbutton-1 chromeclass-toolbar-additional"); // カスタマイズ可能な領域に追加(移動/削除可能にする) navBar.customizationTarget.appendChild(btn); http://egg.5ch.net/test/read.cgi/software/1741415944/332
334: 名無しさん@お腹いっぱい。 [sage] 2025/04/30(水) 19:58:22.48 ID:1+k6CDT60 >>332 CustomizableUI.createWidget使わないと無理 (function () { try { const iconSvg = `<svg xmlns="http://www.w3.org/2000/svg" fill="deepskyblue" viewBox="0 0 24 24"> <path d="M12 6V2L8 6l4 4V7c3.31 0 6 2.69 6 6a6 6 0 0 1-6 6c-2.87 0-5.26-2.01-5.83-4.65H5.06c.6 4 4.04 7.1 8.07 7.1 4.42 0 8-3.58 8-8s-3.58-8-8-8z"/> </svg>`; CustomizableUI.createWidget({ id: 'restart-button', type: 'custom', defaultArea: CustomizableUI.AREA_NAVBAR, onBuild: function(aDocument) { const btn = aDocument.createXULElement('toolbarbutton'); btn.id = "restart-button"; btn.setAttribute("class", "toolbarbutton-1 chromeclass-toolbar-additional"); btn.setAttribute("label", "再起動"); btn.setAttribute("tooltiptext", "Firefoxを再起動します"); btn.style.listStyleImage = `url('data:image/svg+xml;charset=utf-8,${encodeURIComponent(iconSvg)}')`; btn.addEventListener('command', () => Services.startup.quit(Ci.nsIAppStartup.eRestart | Ci.nsIAppStartup.eAttemptQuit)); return btn; } }); } catch(e) { }; })(); http://egg.5ch.net/test/read.cgi/software/1741415944/334
メモ帳
(0/65535文字)
上
下
前次
1-
新
書
関
写
板
覧
索
設
栞
歴
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.025s