Friday, February 12, 2016

How to remove the Archive button from Yahoo! Mail

Yahoo! Mail recently introduced its new "archive" feature, which is nothing more than another folder to store messages in.  But for some reason, Yahoo! decided to place the Archive button exactly where the Delete button used to be on the inbox toolbar -- so now when veteran Yahoo! Mail users try to delete an email, they often find themselves archiving it instead.

This adjustment is a minor inconvenience to some, and a major headache to others.  Fortunately, with a little JavaScript, you can remove the Archive button... as well as move the Delete button back to its rightful position.

Setup is just one step -- copy the JavaScript code below and paste it into a new bookmark on your browser's bookmarks bar.  Executing the function is similarly easy -- just log into Yahoo! Mail and click on the bookmark you made.  That's it.

This script runs best as a bookmark, because you can just click it once (after you log into Yahoo! Mail) and not have to execute anything else.  To remove the Archive button and restore the Delete button to its old position, save the following line of code as a bookmark in your web browser (details for how to do that can be found below):

javascript: (function deArchive(){setInterval(function(){document.getElementById('btn-archive').style.display="none";document.getElementById('btn-delete').style.left="-80px";document.getElementById('btn-move').style.left="80px";},400)})();

It's a lot of text, but it's a very small function that runs quickly and loops to keep that pesky Archive button away.  Once you've added it to your bookmarks bar, click on it once you've logged into Yahoo! Mail.  The archive button will disappear, and the Delete button will return to its previous position.  As long as you don't log out of Yahoo! Mail or refresh the page, the setup will remain that way.  (If you do either of those things, simply click the bookmark link to run the function again.)  You can call the bookmark anything you want that's descriptive for you.

This function was made with plenty of help.  Many thanks to AdBlock for helping to target the pesky Archive button, and to The X Trader for providing the idea to loop the function.

To create a new bookmark in Chrome:
- Right click on empty space in the bookmarks bar
- Click on Add Page...
- Next to Name: type the name you want to call your bookmark (ie. "deArchive")
- Next to URL: type (or copy and paste) the JavaScript code above
- Click Save

If you don't see your bookmarks bar in Chrome, press <CTRL> + <SHIFT> + <B> to make it appear.

To create a new bookmark in Firefox:
- Right click on empty space on the bookmarks bar
- Click on New Bookmark...
- Next to Name: type the name you want to call your bookmark
- Next to Location: type (or copy and paste) the JavaScript code above
- Click Add

To create a new bookmark in Safari:
Follow the steps in this article.  In Step #2, where they tell you to drag the website address you want to bookmark, copy and paste the JavaScript code above instead.

Once you've made the new bookmark, you can move it anywhere on the bookmarks bar by dragging and dropping it.

You will need JavaScript enabled in your web browser (which it probably already is) in order for this function to work.  This article will show you how to enable JavaScript in Chrome if you need to.  For other web browsers, see this Microsoft article.

If the Delete or Move buttons are not lined up well on your screen, you can adjust their position by changing the pixel count in the function (currently '-80px' and '80px', respectively).  The buttons as they are now appear reasonably centered on an 11" Chromebook and two 15.9" Windows PCs, but they may appear out of position on a screen with a different pixel count.

For Chrome users, this function is now available as a Chrome extension.  Just install it in your browser and it will automatically run on Yahoo! Mail pages, so you won't have to click anything or even think about it... the Archive button will automatically disappear when you use Yahoo! Mail and the Delete button will be where you're used to seeing it.

A version of this extension will be coming soon for Opera.

No comments:

Post a Comment