I made a Chrome extension which overrides 'New Tab' page. On the page, I created a clickable icon. I want to click and 'Task Manager' window to appear. Though I overridden the click-event handler (by simulating a keyboard event using KeyboardEvent() constructor) associated to that icon, nothing happens. This is the code:
event1=new KeyboardEvent('keypress',{
bubbles:true,
cancelable:true,
shiftKey:true,
code:'Escape',
key:'Escape'
});
window.dispatchEvent(event1);
return false; //Shift+Escape is Chrome shortcut for Task Manager
What am I doing wrong? I'd rather use Javascript.