Skip to content

Instantly share code, notes, and snippets.

@rtauziac
Last active September 18, 2023 08:11
Show Gist options
  • Save rtauziac/be27e23d779f5a53012cc1e0df429f78 to your computer and use it in GitHub Desktop.
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.
// ==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