Created
May 14, 2019 06:34
-
-
Save joshuahhh/2a30e83d1780066d549bad82ee515a28 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Latest Tweets Only | |
// @description Automatically switches from "Top Tweets" to "Lastest Tweets" (whenever Twitter switches you back). | |
// @match https://twitter.com/home | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
setTimeout(function () { | |
const topTweetsOn = document.querySelector('[aria-label="Top Tweets on"]') | |
if (topTweetsOn) { | |
topTweetsOn.click() | |
setTimeout(function () { | |
const menuItems = document.querySelectorAll('[role="menuitem"]'); | |
menuItems[0].click() | |
}, 100) | |
} | |
}, 400); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment