Last active
January 3, 2020 18:14
-
-
Save glinesbdev/3b1cef601fe48069fc6961bcde432b54 to your computer and use it in GitHub Desktop.
Tamper Monkey Scripts
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 Gitlab search shortcut | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Gives a keyboard shortcut to the search field in Gitlab | |
// @author Bradyn Glines | |
// @include /^https:\/\/gitlab\.*/*/ | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var keys = []; | |
document.addEventListener('keydown', e => { | |
var search = document.querySelector("#search"); | |
keys.push(e.key); | |
if (search) { | |
if (keys.includes('/') && keys.includes('Meta')) { | |
search.focus(); | |
} | |
if (e.key === 'Escape') { | |
search.blur(); | |
} | |
} | |
}) | |
document.addEventListener('keyup', e => { | |
keys = []; | |
}) | |
})(); |
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 YouTube 'Like' Keyboard Shortcut | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Like a YouTube video with a keyboard shortcut | |
// @author Bradyn Glines | |
// @match https://www.youtube.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
if (window.location.href.indexOf('watch?v=') > -1) { | |
document.addEventListener('keyup', e => { | |
if (e.key === ';') { | |
document.querySelector('#menu-container a').click(); | |
} | |
}); | |
} | |
})(); |
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 YTMusic Skip Ad | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Keyboard shortcut to skip YT Music ads | |
// @author Bradyn Glines | |
// @match https://*.youtube.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
if (window.location.href.indexOf('watch?v=') > -1) { | |
document.addEventListener('keyup', e => { | |
if (e.key === '.') { | |
document.querySelector('.ytp-ad-skip-button.ytp-button').click(); | |
} | |
}); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment