Make Twitter DMs appear as if read in all browsers
Posted By Estelle Weyl on September 11, 2012
I use Twitter.com to access my tweets. I do so from several different computers and several different browsers on each of those computers. Since Direct Messages read/unread status is stored in local storage, I have to ‘read’ my DMs in every browser on every computer to make them appear read in each of those browsers. I hate that.
What I hate even more is that I have to click on my account drop down, then on direct messages link, then I have to individually open each DM thread to make them appear read, and back out of it before clearing the next.
This was driving me crazy. So, I created a little bookmarklet. I simply added the bookmarklet to each of my browsers. Now, whenever I see that little blue glow I simply click on the little bookmarklet, and the blue glow disappears until I actually get a new DM.
You can get the bookmarklet from my Github
This bookmarklet will mark all of you Twitter direct messages as read simply by deleting the entry in local storage.
The Code:
//Get the URL
var urlistwitter=window.location.href.split('/')[2].split('.');
// Check to see if the domain is twitter
if(urlistwitter[urlistwitter.length-2]==='twitter') {
// remove the local storage item of unread DM references
window.localStorage.removeItem('dm_threads');
}
// remove the icon that makes them appear unread
document.querySelector('#user-dropdown-toggle .nav-new').classList.remove('nav-new');
Drag this link to your toolbar. When you need to, click it when your Twitter window has focus to remove the localStorage entry and that annoying blue ‘unread’ icon: