/* Dynamic Comments... */

Tuesday, June 28, 2005

Gmail Smart-Delete Button Ver. 0.3.9 Released!

Note: If you have installed version 0.3.9 before June 29th, make sure you have installed the latest version!

[Show Full Post][Show Summary Only...]
The latest version of the Gmail Smart-Delete Button for FireFox's GreaseMonkey extension is Some minor tweaks were performed on the 29th to get the 'd' keyboard shortcut to work properly. It seems quite stable now and I have gotten very positive feedback on this new feature. If you are experiencing any difficulties with the 'd' shorcut, simply re-install the script.

Per user request, it now provides keyboard shortcuts ['D' or 'd'] to delete selected mail items with a single keypress.

(Click to view larger.)

Download version here: Gmail Smart-Delete Button
[To install, right-click the above link & choose 'Install User Script...' from context menu.]

Keep those comments and suggestions coming!
I'll try to implement any useful (and reasonable) suggestions you come up with.
Check back often for updates!

Related Tags:
/ / / / /

[Show Summary Only...]


Blogger chyams said...

and there was much rejoicing (yay).

thanks for the lightning fast turnaround. this addresses my #1 complaint about gmail usability.

6:44 AM, June 29, 2005  
Blogger chyams said...

actually, there is one problem with this implementation. typing a 'd' in the 'to:' field of an email reply triggers the delete logic. even if you choose cancel at this point, the message will still be deleted.

i'm not sure what the simplest way to do this would be, since the delete button is active for the original message of a reply, on the same page as the new message.

a temporary workaround is to reply in a new window, where the problem does not occur.

7:12 AM, June 29, 2005  
Blogger Paul M. said...

I originally tried using:

if ((strTarget != "[object HTMLInputElement]") && (strTarget != "[object HTMLSelectElement]"))

to avoid trapping typing into text fields, but there was a small problem. Since text fields and check
boxes are both HTMLInputElements, after selecting a mail item the delete code would not execute.
You needed to click somewhere else on the page before the delete code would run.

So I changed the code to:

if ((strTarget.name != "q") && (strTarget != "[object HTMLSelectElement]"))

where 'q' is the search field.

Now that you have found that the 'reply to' field needs exclusion, I've modified the code accordingly:

if ((strTarget.name != "q") && (strTarget.name != "to") && (strTarget != "[object HTMLSelectElement]"))

This should fix it.

If you notice anywhere else that should exclude the key trapping, let me know.
In general, I'm sacrificing quite a bit of testing in lieu of a quick turnaround. So any user testing and feedback is greatly appreciated.

The latest version is
Just re-install the script & go.
If you think this revision should merit a new posting, let me know.

8:16 AM, June 29, 2005  
Blogger chyams said...

again, many thanks for the speedy response. this version works now in the 'to' field, but based on your description i tried a few others. the problem exists in the 'cc', 'bcc', 'subject' (when you choose 'edit subject'), and 'attach' (when you attach a file) fields.

i tried the search field, and that caused no problems. not sure if there are others, but those are the ones i could find.

if this is a quick fix, too, probably no need to create a new post.

8:38 AM, June 29, 2005  
Blogger Paul M. said...

I think I found a better way using:

if ((strTarget.type != "text") && (strTarget.type != "textarea") && (strTarget.type != "file")) {

This excludes all text (search field), textarea (BCC, CC, To, Subject) and file (attachments) elements. It also now processes keypresses when the last click was on a select dropdown. I think this behavior is correct.


9:15 AM, June 29, 2005  
Blogger chyams said...

looks great -- works for me in all those cases. many, many thanks.

9:17 AM, June 29, 2005  
Anonymous John Silvestri said...

Oh, that's fantastic! I can weed out my listserve clutter a *lot* faster now...just j||k, then d.

Thank you very much for your excellent work!

11:41 AM, June 30, 2005  
Anonymous Anonymous said...

Is it possible to make a 'delete forever' button in the inbox?

11:32 AM, July 02, 2005  
Anonymous Kristy said...


I've been wishing that Google had thought to include "delete" and "mark as read" buttons--this takes care of half of that! :)

The script appears to be deleting emails as intended, however after installing it, I've noticed that I can no longer use the "Starred" link to select all starred messages in the Inbox.

Well, it seems to select them, as the delete button becomes active, but it does not highlight any messages as it should. All of the other links (All, None, Read, Unread, Unstarred) are working correctly.

10:25 AM, July 08, 2005  
Blogger Paul M. said...

Hi Kristy,

I can't reproduce the problem here. The starred link works properly in the Inbox and all other 'folders'.

We'll need to do some detective work to get to the bottom of this.

Are you ready?

I'm assuming you are using the Windows XP/Firefox 1.04/GreaseMonkey 0.3.3/Smart-Delete combination. If not , let me know what you have.

Let's first see if you can isolate this behavior. GreaseMonkey has a statusbar icon (a monkey face) that, when clicked, toggles GM on and off.
See if, after disabling GM, the problem still exists.

If no, the trouble lies elsewhere, possibly with another firefox extension.

If yes, re-enable GM and, using the 'Tools|Extensions' menuitem, select GM's options dialog. Once there, disable all other GM scripts than Smart-Delete and reload Gmail. (This is accomplished by selecting each script and unchecking its 'enabled' checkbox.)

Again, see if the problem goes away. If yes, enable the other scripts, one at a time, refreshing gmail each time, until the problem resurfaces. That will identify the script giving you trouble.

Let me know the outcome and we'll go on from there.

12:37 PM, July 08, 2005  
Anonymous Kristy said...

"I'm assuming you are using the Windows XP/Firefox 1.04/GreaseMonkey 0.3.3/Smart-Delete combination."

Yep, that all matches what I have--although I do have XP Service Pack 2 installed.

If I disable GreaseMonkey: still having the issue

Disabling all installed scripts except for Delete Button: still persists.

Strange. Maybe it's just me somehow?

Thanks for looking :)

7:00 PM, July 09, 2005  
Blogger Paul M. said...

The next step is to determine if this is a Firefox-specific problem. Try gmail using IE. If problem exists in IE, it looks like a windows issue and we'll have to do further research.
If it is isolated to FF, then run FF in Safe mode by adding the switch to the command line. Then see if there's still the problem.
"C:\Program Files\Mozilla Firefox\firefox.exe" -safe-mode
This will load FF w/o any add-ons, extensions, etc. We can see if you are having trouble with the core install of FF vs one of its extensions giving you trouble.

If the problem goes away in safe mode you can try disabling all the extensions and adding them back one at a time to find the culprit.
If the problem exists in safe mode, try a clean reinstall of FF, as something my have gotten corrupted.


10:11 AM, July 10, 2005  
Anonymous Kristy said...


It seems to be working now. I don't know if I somehow changed something or may have had something else that was affecting it, but seems to be fine.

I guess that's that, then.

5:40 PM, July 10, 2005  
Blogger Taylor said...

Perfect! Thank you.

8:18 PM, July 11, 2005  
Anonymous Anonymous said...

Sometimes when viewing a message, the Delete button is not active. I think I know the sequence that improperly disables it:
1. Open an email. (Delete button active)
2. Use Delete button to delete it. (Returns to list and the deleted email is gone as it should be.)
3. Select the next newer email. (Email opens and Delete button is not active.)

If I select an email other than the next newer one (in other words, read them out of sequence), the Delete button is active as expected.


3:39 PM, July 23, 2005  
Blogger Paul M. said...

Thanks for the heads up! I have released ver 0.4.0 which addresses this. Run it through its paces and see what you think.

11:29 PM, July 23, 2005  

<< Home