Open Stylish 0.5 Help in a new tab instead of a new window

edited March 2007 in Stylish
Here's a userChrome.js script to make the Stylish Manager "Help" button open in a new tab instead of a new window.
Requires WindowHook.

WindowHook.register("chrome://stylish/content/manage.xul", function(aWindow) { var uc_textLinks = aWindow.document.getElementsByTagName("label"); for (var uc_i = 0; uc_i < uc_textLinks.length; uc_i++) { // if (uc_textLinks[uc_i].href.indexOf("userstyles.org")!=-1) { uc_textLinks[uc_i].open = function(event) { var myLink = "http://userstyles.org/stylish/help"; var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var browserWindow = wm.getMostRecentWindow("navigator:browser"); if (window._content.location.href == "about:blank"){ window._content.location.href = myLink; } else { var thisWindow = browserWindow.getBrowser(); var newTab = thisWindow.addTab(myLink, null, null); thisWindow.selectedTab = newTab; } } } });

Comments

  • Is there any way to make all the stylish actions open in a new tab instead of a new window, or do you have to write a script like this for each of them?
Sign In or Register to comment.