Created
April 27, 2020 14:30
-
-
Save hamen/73e3495e48fa0a7e9fcf8ed0b20d1600 to your computer and use it in GitHub Desktop.
This file contains 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 Telegram - Jump to first unread message | |
// @namespace https://ivanmorgillo.com/ | |
// @version 0.1 | |
// @description Kinda Slack shortcut | |
// @author Ivan Morgillo | |
// @match https://web.telegram.org/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
window.$(document).on("keydown", function(e){ | |
if (e.keyCode == 75 && (e.ctrlKey || e.metaKey)){ | |
var unread = window.$( '.im_dialog_badge.badge:not(".ng-hide")' ).first(); | |
if (unread != undefined) { | |
var container = unread.parent().parent(); | |
container.mousedown(); | |
console.log("container clicked"); | |
} | |
} | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment