Created
March 25, 2011 16:13
-
-
Save jblanche/887106 to your computer and use it in GitHub Desktop.
adding the button to the toolbar
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
Application.getExtensions(function (extensions) { | |
let extension = extensions.get('[email protected]'); | |
if (extension.firstRun) { | |
var myId = "enjoyreading-toolbar-button"; // ID of button to add | |
var afterId = "urlbar-container"; // ID of element to insert after | |
var navBar = document.getElementById("nav-bar"); | |
var curSet = navBar.currentSet.split(","); | |
if (curSet.indexOf(myId) == -1) { | |
var pos = curSet.indexOf(afterId) + 1 || curSet.length; | |
var set = curSet.slice(0, pos).concat(myId).concat(curSet.slice(pos)); | |
navBar.setAttribute("currentset", set.join(",")); | |
navBar.currentSet = set.join(","); | |
document.persist(navBar.id, "currentset"); | |
try { | |
BrowserToolboxCustomizeDone(true); | |
} | |
catch (e) {} | |
} | |
} | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment