Tampermonkey のスクリプトを作成しようとしています。これにより、ユーザーがオムニボックスに入力しているときに Shift Enter が押されたときに (これは Chrome 用です)、デフォルトのように新しいウィンドウで検索を開くのではなく、 Shift キーが登録されておらず、現在のタブで検索が開きます (Enter キーだけを押したときのように)。JavaScriptをいじり始めたばかりなので、基本的に自分が何をしているのかわかりません。助けていただければ幸いです。これは私がこれまでに持っているものです:
function supressShiftEnter(event){
if(event.keyCode == 13 && event.shiftKey){
return false;
}
return true;
}
chrome.omnibox.onInputChanged.addListener{
//anytime a key is pressed while in the omnibox supressShiftEnter is run
//If Shift Enter is pressed the Shift key isn't registered and only the enter key is registered
}