Skip to content

Instantly share code, notes, and snippets.

@teramotodaiki
Created December 6, 2022 01:54
Show Gist options
  • Save teramotodaiki/be958b10a40d77930210144ca14a6599 to your computer and use it in GitHub Desktop.
Save teramotodaiki/be958b10a40d77930210144ca14a6599 to your computer and use it in GitHub Desktop.
ChatGPTがIME未確定の時にエンターキーを押すと送信してしまう挙動をやめるやつ
const textarea = document.querySelector('textarea[data-id="root"]');
textarea?.addEventListener(
"keydown",
(event) => {
if (event.key === "Enter" && event.isComposing) {
event.stopPropagation();
}
},
{ capture: true }
);
{
...略...
"manifest_version": 3,
"permissions": ["activeTab"],
"content_scripts": [
{
"matches": ["https://chat.openai.com/chat"],
"js": ["./chatgpt.js"]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment