So, i need to press Ctrl+Shift+Del in a program way. I want my extension to press Ctrl+Shift+Del and then press 'Enter' (to clean all history,cookies,cache and so on). i do next:
var e=document.createEvent('KeyboardEvent');
e.initKeyEvent( 'keypress', true, true, window, true, false, true, false, 46, 0);
document.dispatchEvent(e);
According to how i understand, this code has to emulate pressing Ctrl+Shift+Del
but nothing happens...document.dispatchEvent(e) happens but the window that is called by pressing Ctrl+Shift+Del doesn't appear..why?
p.s.\i know about Components.classes["@mozilla.org/cookiemanager;1"].getService(Components.interfaces.nsICookieManager).removeAll();
but it's not suitable in my situashion.
i do definetly need to "press" these Ctrl+Shit+Del
so..any ideas? see mistakes?