Block Save Keyboard Shortcut in Roam

For people who have a habit of hitting Ctrl+S in Roam, and want to stop the browser save dialog from popping up

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        Block Save Keyboard Shortcut in Roam
// @namespace   https://eriknewhard.com/
// @author      everruler12
// @description For people who have a habit of hitting Ctrl+S in Roam, and want to stop the browser save dialog from popping up
// @version     1.1
// @license     ISC
// @grant       none
// @match       https://roamresearch.com/*
// ==/UserScript==

document.addEventListener("keydown", function(e) {
  if (e.keyCode == 83 && (navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey)) {
    e.preventDefault()
  }
}, false)