Last active
September 25, 2026 05:44
-
-
Save khlizard/410c18f5ba514ead69a4f99425e4ccc7 to your computer and use it in GitHub Desktop.
Perplexity: Disable Ctrl+I Shortcut
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 Perplexity: Disable Ctrl+I Shortcut | |
| // @name:ja Perplexity Ctrl+I ショートカット無効化 | |
| // @namespace https://gist.github.com/khlizard | |
| // @version 1.2.0 | |
| // @description Completely disables the Ctrl+I (Cmd+I) shortcut on Perplexity, including while an IME is composing. | |
| // @description:ja Perplexityのページ上でのCtrl+I(Cmd+I)ショートカットを、日本語入力中も含めて完全に無効化します。 | |
| // @author tokage | |
| // @license MIT | |
| // @match https://www.perplexity.ai/* | |
| // @match https://perplexity.ai/* | |
| // @icon https://www.perplexity.ai/favicon.ico | |
| // @run-at document-start | |
| // @noframes | |
| // @grant none | |
| // @homepageURL https://gist.github.com/khlizard/410c18f5ba514ead69a4f99425e4ccc7 | |
| // @supportURL https://gist.github.com/khlizard/410c18f5ba514ead69a4f99425e4ccc7 | |
| // @downloadURL https://gist.github.com/khlizard/410c18f5ba514ead69a4f99425e4ccc7/raw/disable-ppl-ctrl-i-shortcut.user.js | |
| // @updateURL https://gist.github.com/khlizard/410c18f5ba514ead69a4f99425e4ccc7/raw/disable-ppl-ctrl-i-shortcut.user.js | |
| // ==/UserScript== | |
| (() => { | |
| 'use strict'; | |
| const isCtrlI = (e) => { | |
| if (!(e.ctrlKey || e.metaKey)) return false; | |
| // IME変換中は key が 'Process'、keyCode が 229 になるが、物理キーの code は 'KeyI' のまま残る | |
| if (e.key === 'Process' || e.keyCode === 229) return e.code === 'KeyI'; | |
| return e.key === 'i' || e.key === 'I' || e.keyCode === 73; | |
| }; | |
| const block = (e) => { | |
| if (!isCtrlI(e)) return; | |
| e.preventDefault(); | |
| e.stopImmediatePropagation(); // stopPropagation の効果も含む | |
| }; | |
| // document-start 時点で window のキャプチャフェーズに登録し、ページ側のリスナーより先に処理する | |
| for (const type of ['keydown', 'keypress', 'keyup']) { | |
| window.addEventListener(type, block, true); | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment