Instantly share code, notes, and snippets.
Created
February 5, 2012 16:58
-
Star
(0)
0
You must be signed in to star a gist -
Fork
(0)
0
You must be signed in to fork a gist
-
Save wanabe/1746567 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name ucjs_SlimDialogSidebar_0.2.1.15mod3.uc.js | |
// @namespace http://www.sephiroth-j.de/mozilla/ | |
// @description サイドバーに表示する時に各種ダイアログをスリムにする | |
// @author otokiti | |
// @include chrome://mozapps/content/extensions/extensions.xul | |
// @include chrome://global/content/console.xul | |
// @include chrome://browser/content/preferences/cookies.xul | |
// @include chrome://passwordmgr/content/passwordManager.xul | |
// @include chrome://stylish/content/manage.xul?sidebar=1 | |
// @include chrome://stylish/content/manage-standalone.xul?sidebar | |
// @include chrome://updatescan/content/updatescan.xul | |
// @include chrome://console2/content/console2.xul | |
// @include chrome://mozapps/content/downloads/downloads.xul | |
// @compatibility WindowsXP / Ubuntu8.04(gnome) | |
// @compatibility Firefox 3.0 - 11.0 | |
// @compatibility userChrome.js 0.8 / userChromeJS 1.4 | |
// @compatibility Sub-Script/Overlay Loader v3.0.30mod | |
// @version 0.1: 08/12/15 初版 | |
// @version 0.2: 08/12/29 アドオンでバージョンチェック無視していない場合に対応。 | |
// @version 0.2.0.2: 09/01/12 アドオンで[アドオンを入手]を表示するようにした。 | |
// @version 同、通常表示されないタブもラベル文字をツールチップ化した。 | |
// @version 0.2.0.3: 09/01/14 アドオン・マネージャを少しコンパクトに | |
// @version ucjs_SlimDialogSicebar になってたのを ucjs_SlimDialogSidebar へ | |
// @version 0.2.0.4: 09/02/10 アドオン・マネージャをまた少しコンパクトに | |
// @version 0.2.1.4: 09/02/29 sidebarbutton 2.1.4 に対応 | |
// @version *取りあえずタブでダイアログ開くとスリム化されてしまう。(T-T) | |
// @version 0.2.1.5: 09/03/01 Stylish 1.0a2 へ対応中 | |
// @version 0.2.1.6: 09/03/09 タブに表示中はスリム化しないようにした。 | |
// @version 0.2.1.7: 09/03/20 Stylish 1.0b1 へ対応 | |
// @version 0.2.1.8: 09/03/29 Update Scanner へ対応 | |
// @version 09/04/06 Stylish 1.0b2 へ対応 | |
// @version 0.2.1.9: 09/04/09 Console2 へ対応、コンソールも Console2 と同様にした。 | |
// @version Console2 は Ver.0.3.9.2 以降にのみ対応です。 | |
// @version 0.2.1.10: 09/04/25 Fx3.6a1pre のアドオンの CSS を調整 | |
// @version 0.2.1.11: 09/05/02 Stylish 0.5 系も少し手直し | |
// @version 0.2.1.12: 09/05/31 ダウンロード・マネージャへ対応 | |
// @version reademe.txt: ダウロード・マネージャをサイドバーに表示する場合 | |
// @version 0.2.1.13b: 09/06/27 要素を消す時 remove ではなく style.visibility = 'collapse' とした。 | |
// @version m(_"_)m http://pc12.2ch.net/test/read.cgi/software/1236532418/830 | |
// @version 0.2.1.14: 09/09/26 stylish 1.0 系の新ダイアログ(xul)へ対応 | |
// @version 0.2.1.15: 09/10/28 Custom Download Manager 1.6/2.5以降 に対応 | |
// @version 0.2.1.15mod1: 11/05/01 Fx4 のアドオン・マネージャに対応 | |
// @version 0.2.1.15mod2: 11/05/03 アドオン・マネージャ、ダウンロード・マネージャの手直し。Default4.0/rein4.0a2で確認。 | |
// @version 0.2.1.15mod3: 12/02/06 Fx6 以降対応(URI にファイルを埋め込む場合 base64 エンコーディング必須)、設定でアドオンの有効ボタン等を隠蔽可能に(右クリックで代用可) | |
// @Note 対応:アドオン・マネージャ、エラー・コンソール、クッキー・ダイアログ、ダウンロード・マネージャ | |
// @Note パスワード・マネージャ、スタイリッシュ・ダイアログ、Update Scanner、Console2 | |
// ==/UserScript== | |
(function() { | |
const config = { | |
extension_hide_ver: false, | |
extension_hide_control: false, | |
}; | |
const Cc = Components.classes; | |
const Ci = Components.interfaces; | |
var base64e = function (str) { | |
const table_str = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; | |
var table = new Array(); | |
for (var i = 0; i < 65; i++) { | |
table[i] = encodeURI(table_str.charAt(i)); | |
} | |
var data = ""; | |
var index; | |
for (index = 0; index < str.length; index += 3) { | |
var s1 = str.charCodeAt(index); | |
var s2 = 0; | |
var s3 = 0; | |
var d1, d2, d3 = 64, d4 = 64; | |
if (index + 2 < str.length) { | |
s3 = str.charCodeAt(index + 2); | |
d4 = s3 & 0x3f; | |
} | |
if (index + 1 < str.length) { | |
s2 = str.charCodeAt(index + 1); | |
d3 = ((s2 * 0x100 + s3) >> 6) & 0x3f; | |
} | |
d2 = ((s1 * 0x100 + s2) >> 4) & 0x3f; | |
d1 = (s1 >> 2) & 0x3f; | |
data += table[d1] + table[d2] + table[d3] + table[d4]; | |
} | |
return data; | |
}; | |
// ラベル文字をツールチップとして追加して、ラベルを消す | |
var remove_label = function(id) { | |
var target = document.getElementById(id); | |
target.setAttribute("tooltiptext", target.label); | |
target.removeAttribute("label"); | |
return target; | |
}; | |
// Firefox のバージョンを取得する | |
var getVer = function(){ | |
var info = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo); | |
var ver = parseInt(info.version.substr(0,3) * 10,10) / 10; | |
return ver; | |
}; | |
// サイドバー以外は何もしない | |
var mainWindow = window.QueryInterface(Ci.nsIInterfaceRequestor) | |
.getInterface(Ci.nsIWebNavigation) | |
.QueryInterface(Ci.nsIDocShellTreeItem) | |
.rootTreeItem | |
.QueryInterface(Ci.nsIInterfaceRequestor) | |
.getInterface(Ci.nsIDOMWindow); | |
if (mainWindow.document.getElementById("sidebar-box")==null) return; // ダイアログで表示 | |
if ((window.name != "web-panels-browser") && (window.name != "sidebar")) return; // タブで表示 | |
// if (!window.name) return; // タブで表示 | |
/* ------- stylish 1.0 対応 CSS (ココカラ)----------------- */ | |
// -- 不要な場合 -- | |
// const STYLE10 =""; | |
// -- 必要な場合 -- | |
const STYLE10 = <![CDATA[ | |
#styles-container { /* ダイアログの幅 */ | |
margin-left: 0px !important; | |
margin-right: 0px !important; | |
} | |
#userstyles-heading >label{ /* ヘッダ部分の文字を消す */ | |
visibility: collapse !important; | |
} | |
/* Search(検索) の幅を指定する(現在は無効) */ | |
/* #styles-filter { | |
max-width: 125px!important; | |
}*/ | |
#new-style { /* write new style ボタンを小さく */ | |
padding:0px !important; | |
} | |
#copy-style-info { /* Copy Style Info ボタンを消す */ | |
visibility: collapse !important; | |
} | |
#styles image[anonid="status-icon"] { /* ツリー・アイコンを小さくする */ | |
width:16px !important; | |
height:16px !important; | |
min-width:16px !important; | |
min-height:16px !important; | |
} | |
/* ツリー内のボタンを小さくする */ | |
#styles button { | |
float: left !important; | |
width: auto !important; | |
min-width: 0 !important; | |
-moz-appearance: none !important; | |
border-width: 2pt !important; | |
margin: 1.4pt !important; | |
margin-top: 0 !important; | |
opacity: 0.7 !important; | |
background: buttonface !important; | |
} | |
#styles button:hover:not([disabled]) { | |
opacity: 0.9 !important; | |
} | |
#styles spacer { | |
visibility: collapse !important; | |
} | |
#stylish-manage-standalone > hbox > spacer, | |
#commandBarBottom > spacer { | |
visibility: collapse !important; | |
} | |
]]>.toString().replace(/\s+/g, " "); | |
/* ------- stylish 1.0 対応 CSS (ココマデ)----------------- */ | |
// Stylish 0.5 | |
if (location.href == "chrome://stylish/content/manage.xul?sidebar=1") { | |
// ダイアログの枠幅を狭くする | |
var Dialog = document.getElementById("stylish"); | |
Dialog.setAttribute("style", "padding: 0px !important;"); | |
// Clear ボタンを小さくする | |
var clearButton = document.getElementById("clearFilter"); | |
clearButton.setAttribute("style", "width: auto !important; min-width: 0 !important;"); | |
// ボタンのラベル文字をツールチップとして追加して、ラベルを消す | |
remove_label("add"); | |
remove_label("edit"); | |
remove_label("delete"); | |
remove_label("update"); | |
remove_label("help"); | |
var style = <![CDATA[ | |
#toolbar toolbarbutton > image { | |
width:16px !important; | |
height:16px !important; | |
min-width:16px !important; | |
min-height:16px !important; | |
} | |
]]>.toString().replace(/\s+/g, " "); | |
var ss = document.createProcessingInstruction( | |
'xml-stylesheet', | |
'type="text/css" href="data:text/css;base64,' + base64e(style) + '"' | |
); | |
document.insertBefore(ss, document.documentElement); | |
ss.getAttribute = function(name) { | |
return document.documentElement.getAttribute(name); | |
}; | |
// Stylish 1.0 サイドバー表示 | |
} else if (location.href == "chrome://stylish/content/manage-standalone.xul?sidebar") { | |
var ss = document.createProcessingInstruction( | |
'xml-stylesheet', | |
'type="text/css" href="data:text/css;base64,' + base64e(STYLE10) + '"' | |
); | |
document.insertBefore(ss, document.documentElement); | |
ss.getAttribute = function(name) { | |
return document.documentElement.getAttribute(name); | |
}; | |
// Update Scanner | |
} else if (location.href == "chrome://updatescan/content/updatescan.xul") { | |
// スリムにする CSS | |
var style = <![CDATA[ | |
#UpdateScan-window > vbox > hbox:first-child > toolbarbutton > image{ | |
width:16px !important; | |
height:16px !important; | |
min-width:16px !important; | |
min-height:16px !important; | |
margin: 0px !important; | |
} | |
#UpdateScan-window > vbox > hbox:first-child > button{ | |
width: auto !important; | |
min-width: 0 !important; | |
} | |
]]>.toString().replace(/\s+/g, " "); | |
var ss = document.createProcessingInstruction( | |
'xml-stylesheet', | |
'type="text/css" href="data:text/css;base64,' + base64e(style) + '"' | |
); | |
document.insertBefore(ss, document.documentElement); | |
ss.getAttribute = function(name) { | |
return document.documentElement.getAttribute(name); | |
}; | |
// アドオン | |
} else if (location.href == "chrome://mozapps/content/extensions/extensions.xul") { | |
if ("@mozilla.org/addons/integration;1" in Cc) { | |
var categories = document.getElementById("categories"); | |
if (!categories.addedRebuildEvent) { | |
var display_ver = config.extension_hide_ver ? "none" : ""; | |
var rebuild_func = function() { | |
var addon_list = document.getElementById("addon-list"); | |
addon_list = addon_list.getElementsByTagName("richlistitem"); | |
for (var i = 0; i < addon_list.length; i++) { | |
var names = addon_list[i]._dateUpdated.previousSibling.childNodes; | |
for (var j = 1; names[j].localName == "label"; j++) { | |
var name_style = document.defaultView.getComputedStyle(names[j], null); | |
if (name_style.display != "none") { | |
names[0].tooltipText += " " + names[j].getAttribute("value"); | |
// ver表示をするならvisible、しないならnone | |
names[j].style.display = display_ver; | |
} | |
} | |
} | |
}; | |
setTimeout(rebuild_func, 100); | |
categories.addedRebuildEvent = true; | |
categories._scrollbox.orient = "horizontal"; | |
var onclick = function() {setTimeout(rebuild_func, 100);}; | |
for (var i = 0; i < categories.childElementCount; i++) { | |
var item = categories.children[i]; | |
item.addEventListener("click", onclick, true); | |
} | |
var style = <![CDATA[ | |
#addons-page { | |
padding: 0px; | |
} | |
#header { | |
margin: 2px; | |
} | |
#header spacer { | |
display: none; | |
} | |
#header-search { | |
width: 13em; | |
} | |
#header-utils-btn { | |
min-width: 3.5em; | |
} | |
#header + hbox { | |
-moz-box-orient: vertical; | |
} | |
#categories { | |
padding: 0px; | |
margin: 0px; | |
height: 32px; | |
} | |
.category { | |
padding: 0px; | |
-moz-box-orient: vertical; | |
border-radius: 0px !important; | |
border: 0px !important; | |
} | |
.category[disabled] { | |
display: none; | |
} | |
.category[selected] { | |
border: 1px groove lightgrey !important; | |
margin-bottom: 2px; | |
} | |
.category-name { | |
display: none; | |
} | |
.category-icon { | |
width: 21px; | |
height: 21px; | |
margin: 3px; | |
} | |
.addon-view { | |
margin: 0px; | |
padding: 1px; | |
} | |
.addon-view > hbox{ | |
margin: 0px; | |
} | |
.icon-container { | |
margin: 3px 0px 0px 3px; | |
width: 24px; | |
height: 24px; | |
} | |
.icon { | |
width : 24px; | |
height: 24px; | |
} | |
.basicinfo-container > .name-container > label { | |
font-size: 10px; | |
visibility: visible; | |
} | |
.basicinfo-container > .name-container > .name, .warning, .pending { | |
font-size: 10px; | |
} | |
.advancedinfo-container { | |
-moz-box-orient: vertical; | |
-moz-box-align: start; | |
margin-left: -28px; | |
margin:0px 0px 0px 1px; | |
} | |
.description-container { | |
-moz-box-orient: vertical; | |
-moz-box-align: start; | |
} | |
.details { | |
display: none; | |
} | |
.status-control-wrapper { | |
width: 180px; | |
float:left; | |
margin: 0px 5px 5px 5px; | |
padding: 0px 0px 0px 0px; | |
} | |
.addon-control { | |
margin: 0px; | |
padding: 0px; | |
min-width: 3.8em; | |
} | |
.detail-view-container { | |
padding: 0px; | |
} | |
#detail-notifications { | |
margin: 0px; | |
} | |
#detail-notifications + hbox{ | |
-moz-box-orient: vertical; | |
} | |
#detail-desc-container { | |
-moz-box-orient: vertical; | |
} | |
]]>.toString().replace(/\s+/g, " "); | |
if (config.extension_hide_control) { | |
style += ".status-control-wrapper { display: none;} "; | |
} | |
var ss = document.createProcessingInstruction( | |
'xml-stylesheet', | |
'type="text/css" href="data:text/css;base64,' + base64e(style) + '"' | |
); | |
document.insertBefore(ss, document.documentElement); | |
ss.getAttribute = function(name) { | |
return document.documentElement.getAttribute(name); | |
}; | |
} | |
} else { | |
// タブのラベル文字をツールチップとして追加して、ラベルを消す | |
remove_label("search-view"); | |
remove_label("extensions-view"); | |
remove_label("themes-view"); | |
remove_label("locales-view"); | |
remove_label("plugins-view"); | |
remove_label("updates-view"); | |
remove_label("installs-view"); | |
// ------- stylish 1.0 対応 (ココカラ) ------------------------------ | |
if (document.getElementById("userstyles-view")) { | |
remove_label("userstyles-view"); | |
} | |
// ------- stylish 1.0 対応 (ココマデ) ------------------------------ | |
// バージョンチェック無視のメッセージを消す | |
var Msg = document.getElementById("addonsMsg"); | |
if (Msg.childNodes[1]) //Msg.removeChild(Msg.childNodes[1]); | |
Msg.childNodes[1].setAttribute("hidden", "true"); | |
// リサイザーを消す | |
var resizerBox = document.getElementById("resizerBox"); | |
resizerBox.style.visibility = 'collapse'; | |
// スリムにする CSS | |
if (getVer() > 3.5) { // Fxv3.6 | |
var style = <![CDATA[ | |
#viewGroup { | |
padding: 0px !important; | |
} | |
#viewGroup * { | |
width:22px !important; | |
height:22px !important; | |
min-width:22px !important; | |
min-height:22px !important; | |
padding: 0px !important; | |
} | |
]]>.toString().replace(/\s+/g, " "); | |
} else { // Fx3.0 - 3.5 | |
var style = <![CDATA[ | |
#viewGroup * { | |
width:24px !important; | |
height:24px !important; | |
min-width:24px !important; | |
min-height:24px !important; | |
padding: 0px !important; | |
} | |
]]>.toString().replace(/\s+/g, " "); | |
} | |
// 共通部分 | |
style = style + <![CDATA[ | |
#topBar > deck { | |
height:24px !important; | |
min-height:24px !important; | |
} | |
.addonIcon { | |
width:32px !important; | |
height:24px !important; | |
min-width:32px !important; | |
min-height:24px !important; | |
} | |
.addonIcon >image, .addonIconStack{ | |
width:24px !important; | |
height:24px !important; | |
min-width:24px !important; | |
min-height:24px !important; | |
} | |
#extensionsView richlistitem { | |
padding-bottom: 3px !important; | |
padding-top: 3px !important; | |
} | |
#addonsMsg *, #topStackBar *, #myconfigView * { | |
margin:0.25px !important; | |
padding:0.25px !important; | |
} | |
#commandBarBottom { | |
margin-top: 2px !important; | |
margin-bottom: 0px !important; | |
} | |
.selectedButtons { | |
float: left !important; | |
margin-top: -2.1em !important; | |
text-align: left !important; | |
padding-left: 2.1pt !important; | |
} | |
.selectedButtons button { | |
width: auto !important; | |
min-width: 0 !important; | |
-moz-appearance: none !important; | |
border-width: 2pt !important; | |
margin: 1.4pt !important; | |
margin-top: 0 !important; | |
opacity: 0.7 !important; | |
background: buttonface !important; | |
} | |
.selectedButtons button:hover { | |
opacity: 0.9 !important; | |
} | |
.selectedButtons spacer { | |
visibility: collapse !important; | |
} | |
.selectedStatusMsgs { | |
visibility: collapse !important; | |
} | |
]]>.toString().replace(/\s+/g, " ") + STYLE10; | |
var ss = document.createProcessingInstruction( | |
'xml-stylesheet', | |
'type="text/css" href="data:text/css;base64,' + base64e(style) + '"' | |
); | |
document.insertBefore(ss, document.documentElement); | |
ss.getAttribute = function(name) { | |
return document.documentElement.getAttribute(name); | |
}; | |
} | |
// ダウンロード・マネージャ | |
} else if (location.href == "chrome://mozapps/content/downloads/downloads.xul") { | |
var style = <![CDATA[ | |
.downloadTypeIcon { /* ツリー・アイコンを小さくする */ | |
width:16px !important; | |
height:16px !important; | |
min-width:16px !important; | |
min-height:16px !important; | |
} | |
#downloadView richlistitem,#clearListButton, #searchbox { /* フォントを小さくする */ | |
font-size: 10px !important; | |
} | |
#clearListButton image{ /* 履歴消去アイコンの位置補正 */ | |
margin: 0px 3px 0px -4px; | |
} | |
]]>.toString().replace(/\s+/g, " "); | |
try { // Custom Download Manager 2.5以降 | |
if (typeof cdmSpecialListener.onDownloadStateChange == "function") { | |
style = style + <![CDATA[ | |
#showOptions, #clearListButton { | |
width: 21px !important; | |
height: 22px !important; | |
} | |
#showOptions image, #clearListButton image { | |
width: 13px !important; | |
height: 16px !important; | |
} | |
#CDMCopyLink, #CDMGoToDownPage, #CDMShowFolder { | |
width: 14px !important; | |
height: 14px !important; | |
} | |
#CDMCopyLink image, #CDMGoToDownPage image, #CDMShowFolder image { | |
width: 6px !important; | |
height: 12px !important; | |
} | |
]]>.toString().replace(/\s+/g, " "); | |
} | |
} catch(e) { | |
try { // Custom Download Manager 1.6 | |
if (typeof onWLoad == "function") { | |
style = style + <![CDATA[ | |
#clearListButton > hbox > image{ | |
visibility: collapse !important; | |
} | |
]]>.toString().replace(/\s+/g, " "); | |
} | |
} catch(e) {} | |
} | |
var ss = document.createProcessingInstruction( | |
'xml-stylesheet', | |
'type="text/css" href="data:text/css;base64,' + base64e(style) + '"' | |
); | |
document.insertBefore(ss, document.documentElement); | |
ss.getAttribute = function(name) { | |
return document.documentElement.getAttribute(name); | |
}; | |
// コンソール | |
} else if (location.href == "chrome://global/content/console.xul") { | |
// ラベル文字をツールチップとして追加して、ラベルを消す | |
remove_label("Console:modeAll"); | |
remove_label("Console:modeErrors"); | |
remove_label("Console:modeWarnings"); | |
remove_label("Console:modeMessages"); | |
remove_label("Console:clear"); | |
// スリムにする CSS | |
var style = <![CDATA[ | |
#ToolbarMode .toolbarbutton-text{ | |
visibility: collapse !important; | |
} | |
#ToolbarMode toolbarbutton { | |
padding:0px !important; | |
max-width: 24px !important; | |
min-width: 24px !important; | |
} | |
#ToolbarMode toolbarbutton > image { | |
width:20px !important; | |
height:24px !important; | |
} | |
]]>.toString().replace(/\s+/g, " "); | |
var ss = document.createProcessingInstruction( | |
'xml-stylesheet', | |
'type="text/css" href="data:text/css;base64,' + base64e(style) + '"' | |
); | |
document.insertBefore(ss, document.documentElement); | |
ss.getAttribute = function(name) { | |
return document.documentElement.getAttribute(name); | |
}; | |
// コンソール2 | |
} else if (location.href == "chrome://console2/content/console2.xul") { | |
// ラベル文字をツールチップとして追加して、ラベルを消す | |
remove_label("item_modeAll"); | |
remove_label("item_modeErrors"); | |
remove_label("item_modeWarnings"); | |
remove_label("item_modeMessages"); | |
remove_label("item_clearConsole"); | |
// スリムにする CSS | |
var style = <![CDATA[ | |
#ConsoleToolbox, #ConsoleBox { | |
margin-left: 0px !important; | |
margin-right: 0px !important; | |
} | |
#ToolbarMode .toolbarbutton-text, | |
#search-box > label{ | |
visibility: collapse !important; | |
} | |
#ToolbarMode toolbarbutton { | |
padding:0px !important; | |
max-width: 24px !important; | |
min-width: 24px !important; | |
} | |
#ToolbarMode toolbarbutton > image { | |
width:16px !important; | |
height:16px !important; | |
min-width:16px !important; | |
min-height:16px !important; | |
} | |
#ToolbarExt > * { | |
font-size: 10px !important; | |
padding:0px !important; | |
} | |
]]>.toString().replace(/\s+/g, " "); | |
var ss = document.createProcessingInstruction( | |
'xml-stylesheet', | |
'type="text/css" href="data:text/css;base64,' + base64e(style) + '"' | |
); | |
document.insertBefore(ss, document.documentElement); | |
ss.getAttribute = function(name) { | |
return document.documentElement.getAttribute(name); | |
}; | |
// クッキー | |
} else if (location.href == "chrome://browser/content/preferences/cookies.xul") { | |
// locale の設定 true: 英語 false: 日本語 | |
var locale = (Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefService).getBranch("").getCharPref("general.useragent.locale")=="en-US" )? true: false; | |
var label_removeCookie = locale? "Remove": "\u524a\u9664"; | |
var label_removeAllCookies = locale? "Remove All": "\u3059\u3079\u3066\u3092\u524a\u9664"; | |
// ボタンのラベル文字を短く | |
var removeCookie = document.getElementById("removeCookie"); | |
removeCookie.setAttribute("label", label_removeCookie); | |
var removeAllCookies = document.getElementById("removeAllCookies"); | |
removeAllCookies.setAttribute("label", label_removeAllCookies); | |
// 閉じるボタンを消す | |
removeAllCookies.parentNode.childNodes[3].style.visibility = 'collapse'; | |
// リサイザーを消す | |
removeAllCookies.parentNode.parentNode.lastChild.style.visibility = 'collapse'; | |
// 説明文字を消す | |
var cookiesIntro = document.getElementById("cookiesIntro"); | |
cookiesIntro.style.visibility = 'collapse'; | |
// スリムにする CSS | |
var style = <![CDATA[ | |
#CookiesDialog > vbox { | |
margin-left: 0px !important; | |
margin-right: 0px !important; | |
} | |
#clearFilter { | |
width: auto !important; | |
min-width: 0 !important; | |
} | |
]]>.toString().replace(/\s+/g, " "); | |
var ss = document.createProcessingInstruction( | |
'xml-stylesheet', | |
'type="text/css" href="data:text/css;base64,' + base64e(style) + '"' | |
); | |
document.insertBefore(ss, document.documentElement); | |
ss.getAttribute = function(name) { | |
return document.documentElement.getAttribute(name); | |
}; | |
// パスワード | |
} else if (location.href == "chrome://passwordmgr/content/passwordManager.xul") { | |
// Clear ボタンを小さくする(Fx3.1以降では Clear ボタンは無い) | |
var clearButton = document.getElementById("clearFilter"); | |
if (clearButton) clearButton.setAttribute("style", "width: auto !important; min-width: 0 !important;"); | |
// 閉じるボタンを消す | |
var Dialog = document.getElementById("SignonViewerDialog"); | |
Dialog.childNodes[5].style.visibility = 'collapse'; | |
// パスワード表示ボタンを消す | |
var togglePasswords = document.getElementById("togglePasswords"); | |
togglePasswords.style.visibility = 'collapse'; | |
// 説明文字を消す | |
var signonsIntro = document.getElementById("signonsIntro"); | |
signonsIntro.style.visibility = 'collapse'; | |
// ダイアログは枠幅を狭くする | |
var box = document.getElementById("savedsignons"); | |
box.setAttribute("style", "margin-left: 0px !important; margin-right: 0px !important;"); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment