1

I'm trying to write a script for Tampermonkey so that when Shift Enter is pressed while the user is typing in the omnibox (this is meant for Chrome), instead of opening the search up in a new window like it does on default, the shift key isn't registered and the search opens up in the current tab (like when one presses just the enter key). I've only just started messing around with JavaScript, so basically I have no idea what I'm doing and would appreciate any help. This is what I have so far:

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 
}
NeilW
  • 33
  • 6

0 Answers0