Created
July 15, 2016 01:13
-
-
Save mdusher/1ceaf49c6af86f03505079b5ea6a04c1 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 NewTweetClicker | |
// @version 0.1 | |
// @description Clicks the new tweet bar automatically | |
// @author Michael Usher | |
// @match https://www.twitter.com/* | |
// @match https://twitter.com/* | |
// @grant none | |
// ==/UserScript== | |
/* jshint -W097 */ | |
'use strict'; | |
var $ = window.jQuery; | |
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver; | |
$(document).ready(function(){ | |
var obs = new MutationObserver (clickNewTweetHandler); | |
var obsConfig = { childList: true, characterData: true, attributes: true, subtree: true }; | |
var obsRoot = $('.stream-container'); | |
obsRoot.each(function() { obs.observe(this, obsConfig); }); | |
function clickNewTweetHandler(m) { | |
if ($('.new-tweets-bar').length > 0) { $('.new-tweets-bar').click() ; } | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment