Skip to content

Instantly share code, notes, and snippets.

@Qofar
Last active August 29, 2015 14:10
Show Gist options
  • Save Qofar/5a21e768268b56a8c4ed to your computer and use it in GitHub Desktop.
Save Qofar/5a21e768268b56a8c4ed to your computer and use it in GitHub Desktop.
TweetDeckで簡易既読管理するUserScript vキー押下でツイートが非表示になるだけ shift+vキーで非表示解除
// ==UserScript==
// @name Tweetdeck Show/Hide Tweet
// @include https://tweetdeck.twitter.com/*
// @version 1.0
// @license MIT License
// ==/UserScript==
(function() {
var KEY_CODE = 86;
function showTweet(e) {
var articles = document.querySelectorAll('article.stream-item.js-stream-item');
for (var i = 0, length = articles.length; i < length; i++) {
// articles[i].style.display = e ? 'block' : 'none';
articles[i].style.visibility = e ? 'visible' : 'hidden';
}
};
document.documentElement.addEventListener('keydown', function(e) {
if (e.keyCode === KEY_CODE && !e.ctrlKey && !e.altKey && !e.metaKey && !/^input|^textarea/i.test(e.target.tagName)) {
showTweet(e.shiftKey);
}
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment