Fluid Gmail Userscript
This userscript seems to fix the infamous (and highly annoying) empty popup window bug in Fluid Gmail SSBs when clicking on a link out side of google.com.
Can anyone please take a look, make improvements, and post your version to www.pastie.org? Thanks! Bonus points if you can add Dock badge unread count support, dock menu support, or anything interesting with Growl Notifications (like Jesse did for the Google Reader script). Any improvements you make will likely be included in the release. I’ll certainly add your name to the credits in the About box, and praise your 1337 skillz here and on fluidapp.com (whatever that’s worth! :0p).
Note that I’m planning on shipping the next version Fluid with a small collection of Userscripts to totally replace all site-specific functionality currently in Fluid proper. That would include Gmail, Google Reader, Facebook, Yahoo! Mail and Flickr. If anyone wants to tackle these to help get this release out sooner, I’d be thrilled.
Sooo… feedback on the script below?
// ==UserScript==
// @name Gmail
// @namespace http://fluidapp.com
// @description Gmail features for Fluid
// @include http://mail.google.com/*
// @author Todd Ditchendorf
// ==/UserScript==
(function () {
var closeId = null;
var popUpWindow = null;
var oldOpen = window.open;
window.open = function() {
var url = arguments[0];
if (!url) {
clearTimeout(closeId);
closeId = setTimeout(closeWindow, 100);
}
var res = oldOpen.apply(window, arguments);
if (res) {
popUpWindow = res;
}
return res;
};
function closeWindow() {
popUpWindow.close();
}
})();
March 5th, 2008 at 2:30 am
Oh… and BTW, I have an unhealthy hatred of underscores… so you’re welcome to use them in your scripts, but any scripts that ship with fluid will be stripped of underscores and replaced with glorious, beautiful camel case variables. sorry!! :0]
March 5th, 2008 at 5:02 am
Hi,
I know that Fluid it self is not open source, but have you consider hosting or encouraging some sort of open source effort for user scripts?
Like TextMate and the bundle repository.
Best regards,
March 5th, 2008 at 8:40 am
While I’m slammed today and can’t put much work into it, I’d love to port this to the Google Reader userscript as well so that the ‘v’ keyboard shortcut doesn’t open an extra popup.
Thoughts on github.com as a repository for the userscripts? It’s free for open source efforts.
March 5th, 2008 at 9:17 am
I have a slightly updated version at http://docwhat.gerf.org/files/tmp/gmailfix.user.js
Basically: I fixed a problem where window.open() kept being overridden ad infinitum and added the https://... url to be included.
Ciao!
March 22nd, 2008 at 6:10 pm
It would be much easier if this script were submitted to Userscripts.org, as that would allow easy installation via Fluid. It would also make it easy to find all fluid scripts in one place if everyone did this.
Thanks!
April 14th, 2008 at 11:15 pm
Hi, just been trying this with 0.8.9 and it seems ‘reload userscripts’ doesn’t work. I had to quit and re-open the SSB to both enable the userscript and to have any changes to the script file reloaded.
April 26th, 2008 at 10:49 am
Hey, I modified the Google Reader script and just added gmail wherever it had google reader. Really, I had no idea what I was doing, but now I have growl notifications for Gmail! Check it out:
http://pastie.caboo.se/187253
May 27th, 2008 at 7:20 am
Hi.
Im no developer or similar so I cant solve this issue on my own.
When I display my Gmail account in the language German - the dock badge flickers which is not the case as soon as I switch to English (US).
The badge reloads for 3 seconds and then is displayed for 10 if I change the interval to 10000 - as soon as I switch to German, this behavior is turned around.
September 25th, 2008 at 10:46 am
@bannus - awesome. growl notifications totally work. though i think i still prefer running google notifier side by side with my fluid gmail app - that way i get growl notification with each new email.