Skip to content

Instantly share code, notes, and snippets.

@oflow
Created November 15, 2017 08:03
Show Gist options
  • Save oflow/27cfe904b0b29779afc0590d9b8f74c1 to your computer and use it in GitHub Desktop.
Save oflow/27cfe904b0b29779afc0590d9b8f74c1 to your computer and use it in GitHub Desktop.
開発ツールを開くボタンがツールバーにあればFirebug必要ないのでは
// ==UserScript==
// @name DevTools Toggle Toolbarbutton
// @version 1.0
// ==/UserScript==
(function() {
CustomizableUI.createWidget({
id: 'ucjs-devtools-toggle-button',
type: 'custom',
defaultArea: CustomizableUI.AREA_NAVBAR,
onBuild: function(aDocument) {
var btn = aDocument.createElementNS('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'toolbarbutton');
var attributes = {
id: 'ucjs-devtools-toggle-toolbarbutton',
class: 'toolbarbutton-1 chromeclass-toolbar-additional',
removable: 'true',
oncommand: 'gDevToolsBrowser.toggleToolboxCommand(gBrowser);',
label: '\u958B\u767A\u30C4\u30FC\u30EB',
image: 'data:image/png;base64,Base64エンコードしたアイコン'
};
for (var a in attributes) {
btn.setAttribute(a, attributes[a]);
}
return btn;
}
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment