Created
April 27, 2020 14:30
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 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