Created
April 25, 2012 12:59
-
-
Save Griever/2489554 to your computer and use it in GitHub Desktop.
komono
This file contains hidden or 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
// 最後に開いたサイドバーを記憶してトグル | |
window.toggleSidebar_org = window.toggleSidebar; | |
eval("window.toggleSidebar = " + window.toggleSidebar_org.toString() | |
.replace(/if \(!commandID\) \{[^}]+}/, <![CDATA[ | |
var lastcommand = sidebarBox.getAttribute("sidebarcommand") || | |
sidebarBox.getAttribute("sidebarlastcommand") || | |
"viewBookmarksSidebar"; | |
sidebarBox.setAttribute('sidebarlastcommand', lastcommand); | |
document.persist("sidebar-box", "sidebarlastcommand"); | |
if (!commandID) { | |
commandID = lastcommand; | |
} | |
]]>) | |
); | |
// WebPanel でリンクを使えるようにする | |
eval("window.asyncOpenWebPanel = " + window.asyncOpenWebPanel.toString().slice(0, -1) + | |
'var wpb = sidebar.contentDocument.getElementById("web-panels-browser");' + | |
'if (wpb) wpb.removeAttribute("onclick");' + '}' | |
); | |
// openLinkInでjavascriptスキームは現在のタブに | |
eval("window.openLinkIn = " + window.openLinkIn.toString().replace( | |
'var w = getTopWin();', | |
'var w = getTopWin(); if (where != "current" && /^javascript\:/i.test(url)) where = "current";' | |
)); | |
// about:addons などでツールバーを隠す関数を殺す | |
XULBrowserWindow.hideChromeForLocation = function() false; | |
// 右クリックの「要素の調査」で HTML ツリーを最初から表示 | |
nsContextMenu.prototype.inspectNode = function CM_inspectNode() { | |
if (InspectorUI.isTreePanelOpen) { | |
InspectorUI.inspectNode(this.target); | |
InspectorUI.stopInspecting(); | |
} else { | |
InspectorUI.openInspectorUI(this.target); | |
var itt = document.getElementById('inspector-treepanel-toolbutton'); | |
if (!itt.checked) | |
itt.click() | |
} | |
} | |
// 外部アプリからページを開く際に Firefox を前面にしない | |
if (!nsBrowserAccess.prototype.openURI_org) | |
nsBrowserAccess.prototype.openURI_org = nsBrowserAccess.prototype.openURI; | |
eval("nsBrowserAccess.prototype.openURI = " + nsBrowserAccess.prototype.openURI_org.toString().replace( | |
"newWindow.focus();", | |
"" | |
)); | |
browserDOMWindow = new nsBrowserAccess(); | |
// 文字エンコーディングを右クリックメニューにも | |
let (m = document.getElementById('charsetMenu').cloneNode(true)) { | |
document.getElementById('contentAreaContextMenu').appendChild(m).id += 2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment