Skip to content

Instantly share code, notes, and snippets.

@Neko7sora
Created December 16, 2021 10:04
Show Gist options
  • Save Neko7sora/5f556ea281743144d26be54fb09a29f3 to your computer and use it in GitHub Desktop.
Save Neko7sora/5f556ea281743144d26be54fb09a29f3 to your computer and use it in GitHub Desktop.
DevTools shortcuts disable
//キーボード ショートカット無効化
//https://docs.microsoft.com/ja-jp/microsoft-edge/webview2/concepts/browser-features
window.document.onkeydown = function (evt) {
if (
//Ctrl + Shift + I DevTools を開く/閉じる
(evt.which == 73 && evt.ctrlKey == true && evt.shiftKey == true)
//Ctrl + Shift + J DevTools コンソールを開く
|| (evt.which == 74 && evt.ctrlKey == true && evt.shiftKey == true)
//Ctrl + Shift + C Open DevTools Inspect
|| (evt.which == 67 && evt.ctrlKey == true && evt.shiftKey == true)
//F12 DevTools を開く/閉じる
|| (evt.which == 123)
) {
evt.which = null;
return false;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment