Last active
September 18, 2023 08:11
-
-
Save rtauziac/be27e23d779f5a53012cc1e0df429f78 to your computer and use it in GitHub Desktop.
Back and Forward, Finally… A userscript for Safari that enables mouse buttons for navigating back and forward.
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 BFF | |
// @description Back and Forward, Finally… A userscript for Safari that enables mouse buttons for navigating back and forward. | |
// @namespace mailto:crazyrems@hey.com | |
// @author crazyrems | |
// @version 1 | |
// @match *://*/* | |
// @grant none | |
// ==/UserScript== | |
document.addEventListener('mousedown', function(event) { | |
if (event.buttons & 8) { | |
// Bouton "Précédent" | |
window.history.back(); | |
} else if (event.buttons & 16) { | |
// Bouton "Suivant" | |
window.history.forward(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment