IBM Workload Deployer tip: Automatically rename identically labeled browser tabs

Generate unique tab names using a scripting extension for Firefox or Chrome

Work more efficiently with IBM® Workload Deployer by automatically assigning unique tab names when multiple Workload Deployer consoles are open in your browser. David Leigh shares a script that Firefox and Chrome users can run to differentiate otherwise identically named tabs.

Share:

David Leigh (dleigh@us.ibm.com), Strategy Architect, IBM

David LeighDavid Leigh has a broad range of experience and skills across the IBM Software Group portfolio and for many years has been involved in designing and building business solutions leveraging a wide variety of products and technologies. He has worked as a test architect to improve the consumability and quality of cross-brand IBM software solutions, and more recently he has worked to leverage IBM products and technologies to provide value to IBM internal teams, especially in the areas of test tooling infrastructure and cloud technologies. David has authored a number of Redbooks® and articles in areas that include build automation, web services security, and business process automation.



16 April 2013

Private cloud users and administrators who use IBM Workload Deployer frequently find themselves working with multiple Workload Deployer consoles at the same time. Browser tabs are a great convenience in this situation, but only up to a point. Your browser can easily fill up with identically named tabs, as shown in Figure 1, and then trying to find the right console can be a source of irritation and delay.

Figure 1. Multiple browser tabs with the same name
Screenshot of multiple IBM Workload Deployer consoles open in a browser, all with the name of IBM Workload Deployer

I've tried to devise conventions for ordering the tabs in my browser (for example, keeping the most frequently used consoles on the far left side), but those attempts were ultimately ineffective.

The basic problem is that a browser tab name uses the contents of the displayed web page's <title> element, and all Workload Deployer consoles use the same page title: IBM Workload Deployer. This problem calls for a way to rename the page titles to something more meaningful so that you can quickly find whichever tab you're looking for.

My frustration ultimately drove me to do a web search on tab renaming, which led me to a solution that uses Greasemonkey (see Resources). Greasemonkey is a Firefox add-on that manages JavaScript scripts that you either create yourself or download. These user scripts run when a web page loads to change the way the page looks or behaves. Changing a page title is a good use for Greasemonkey. A similar extension, called Tampermonkey, is available for the Chrome browser (see Resources). (I'm unfamiliar with Internet Explorer extensions that support user scripts; if you can recommend one, please add a comment to this article.)

Renaming browser tabs

Here are the steps for using Greasemonkey or Tampermonkey to rename your browser tabs:

  1. Install the Greasemonkey add-on for Firefox or the Tampermonkey extension for Chrome and make sure that it is enabled.
  2. Click the menu option to install a new user script:
    • In Firefox, select Tools > Greasemonkey > New User Script.
    • In Chrome, click the Tampermonkey icon in the upper right corner of the page, and select Add a new script.
  3. Copy and paste the script in Listing 1:
    Listing 1. User script for tab renaming
    // ==UserScript==
    // @name        rename tabs
    // @namespace   http://userscripts.org/users/myNamespace
    // @grant none
    // @version     1
    // @include *
    // ==/UserScript==
    if ((document.title == "IBM Workload Deployer")||
        (document.title == "IBM SmartCloud Provisioning") || 
        (document.title == "IBM PureApplication System")) {
       match_data = document.URL.match(/^https:\/\/(.*)\.rtp.raleigh.ibm.com*/);
       if (match_data != null) {
         document.title = match_data[1];
       } else {
         document.title = document.location.hostname
       }
    }

    This script trims off the domain name for IBM Workload Deployer clouds in the Raleigh IBM lab; in your script, substitute the domain name that you connect to. The IP address is displayed in the tab instead if that's what you use to connect to the console. I'm sure there are more efficient and elegant ways to accomplish the task; I'll leave it to you to suggest improvements.

  4. Tell Greasemonkey (or Tampermonkey) to enable your script, and try loading a Workload Deployer console.

You should see that the page title (and therefore also the tab name) has been replaced by either the host name or the IP address of your IBM Workload Deployer console. Figure 2 shows my results for multiple tabs:

Figure 2. Uniquely named IBM Workload Deployer tabs
Screenshot of automatically renamed IBM Workload Deployer tabs

I'm quite pleased with this solution. I know I won't miss having to guess which tab is which!


Conclusion

User scripts seem like a great way to differentiate the web pages of (otherwise identical) systems. Many a time I've thought that I was using the web interface of my production web server when I was really using the web interface of my test web server. In most cases, it would be trivial to leverage user scripts to (for example) change the background color of the page so that you can quickly tell which server's web interface you are using.

Resources

Learn

  • IBM Workload Deployer: Access a wide variety IBM Workload Deployer resources from this developerWorks community page.
  • Explore developerWorks Cloud computing, where you will find valuable community discussions and learn about new technical resources related to the cloud.

Get products and technologies

  • Greasemonkey: Install Greasemonkey from the Mozilla Add-ons site.
  • Tampermonkey: Install Tampermonkey from the Chrome Web Store.

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Cloud computing on developerWorks


  • Bluemix Developers Community

    Get samples, articles, product docs, and community resources to help build, deploy, and manage your cloud apps.

  • developerWorks Labs

    Experiment with new directions in software development.

  • DevOps Services

    Software development in the cloud. Register today to create a project.

  • Try SoftLayer Cloud

    Deploy public cloud instances in as few as 5 minutes. Try the SoftLayer public cloud instance for one month.

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Cloud computing, WebSphere
ArticleID=870622
ArticleTitle=IBM Workload Deployer tip: Automatically rename identically labeled browser tabs
publish-date=04162013