Permalink
Browse files

Increase discoverability by inserting the toolbar button, once.

  • Loading branch information...
1 parent fe242f9 commit cf8189d9997bc9bed42b8645d612f683d161165b @arantius arantius committed Apr 5, 2011
Showing with 16 additions and 0 deletions.
  1. +15 −0 content/browser.js
  2. +1 −0 defaults/preferences/greasemonkey.js
View
@@ -87,6 +87,8 @@ GM_BrowserUI.chromeLoad = function(e) {
// reference this once, so that the getter is called at least once, and the
// initialization routines will run, no matter what
GM_BrowserUI.gmSvc.config;
+
+ GM_BrowserUI.showToolbarButton();
};
/**
@@ -327,6 +329,19 @@ GM_BrowserUI.nodeInserted = function(aEvent) {
}
};
+GM_BrowserUI.showToolbarButton = function() {
+ // Once, enforce that the toolbar button is present. For discoverability.
+ if (!GM_prefRoot.getValue('haveInsertedToolbarbutton')) {
+ GM_prefRoot.setValue('haveInsertedToolbarbutton', true);
+
+ var navbar = document.getElementById("nav-bar");
+ var newset = navbar.currentSet + ",greasemonkey-tbb";
+ navbar.currentSet = newset;
+ navbar.setAttribute("currentset", newset);
+ document.persist("nav-bar", "currentset");
+ }
+};
+
GM_BrowserUI.init();
@@ -4,3 +4,4 @@ pref("greasemonkey.fileIsGreaseable", false);
pref("greasemonkey.unmhtIsGreaseable", false);
pref("greasemonkey.enableScriptRefreshing", true);
pref("greasemonkey.uninstallPreferences", true);
+pref("greasemonkey.haveInsertedToolbarbutton", false);

0 comments on commit cf8189d

Please sign in to comment.