Skip to content

Instantly share code, notes, and snippets.

@warrenseine
Created March 21, 2024 15:28
Show Gist options
  • Save warrenseine/b4f73b9125dec3d354bb6c7a19daebc4 to your computer and use it in GitHub Desktop.
Save warrenseine/b4f73b9125dec3d354bb6c7a19daebc4 to your computer and use it in GitHub Desktop.
Duplicate current tab with Cmd + D
// ==UserScript==
// ==UserScript==
// @name Duplicate tab
// @namespace http://tampermonkey.net/
// @version 2024-03-21
// @description Duplicate current tab with Cmd + D
// @author Warren Seine
// @match *://*/*
// @grant none
// ==/UserScript==
(function() {
window.addEventListener("keydown", e => {
if (e.code == "KeyD" && e.metaKey) {
window.open(document.location.href, '_blank').focus();
}
})
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment