This is a quick update to give Chrome users a better wrapper that detects whether the code has already been run. This avoids the issue of having multiple grab bars appearing.
I’ve posted the new wrapper code below. If you’re not familiar with how to use the code, following these steps should get you up and running:
- Copy the code below into a text editor
- Copy the “full monty” code from my previous post and paste it into the text editor after the line that reads “// Insert code here.”
- Save the file with a name that ends in “.user.js”, for example, “chromeGmailResizer.user.js”. Note: the “.user.js” extension is important as tells Chrome that this code is to be installed as a user script
- Drag the file into Chrome
- You should see a security message similar to this:
Click the “Continue” button - You should see another security message similar to this:
Click the “Add” button - You should see a confirmation message similar to this:
- Load Gmail, and you should see the grab bar ready to go!
// ==UserScript== // @name Gmail label column resizer // @namespace http://www.codecouch.com/ // @description User script that allows the labels column in Gmail to be resized // @include http://mail.google.com/* // @include https://mail.google.com/* // @match http://mail.google.com/* // @match https://mail.google.com/* // @version 1.1 // @history 1.1 Stopped duplicate grab bars and added more URL matching // @history 1.0 Initial version // ==/UserScript== var loadGmailResizer = function() { if (typeof(gmonkey) != 'object' || !('load' in gmonkey)) return; // Test that there's not already a grab bar present if (top.loadedGmailResizer) return; top.loadedGmailResizer = true; // Insert code here. // No modification to the code is needed when running in Chrome, so the first line of code should still read: // // gmonkey.load(2, function(o) { }; var d = document, s = d.createElement('script'); s.type = 'text/javascript'; s.textContent = '(' + loadGmailResizer.toString() + ')()'; d.body.appendChild(s);