-6

Anybody know How do manually trigger the F12 (Developer Tool panel) in Jquery or Javascript

I Tried using click event like this

$(document).click(function(event) {
   if(event.which === 123){
      //I do not know what code comes here
   }
});

$(document).trigger("click");

Anybody do research on this...

Rajaprabhu Aravindasamy
  • 66,513
  • 17
  • 101
  • 130
Sudharsan S
  • 15,336
  • 3
  • 31
  • 49
  • http://stackoverflow.com/questions/4575134/how-can-i-open-the-google-chrome-console-from-javascript – Rajaprabhu Aravindasamy Jul 25 '14 at 06:42
  • @RajaprabhuAravindasamy - I am asking on document click – Sudharsan S Jul 25 '14 at 06:44
  • Imagine you visit a site that by just running `Browser.showDevTools()` the dev panel suddenly appeared. Wouldn't be stupidly annoying? That's why there are so many things you cannot do from Javascript in a generic browser. The user must have always control on what the page does. – Claudi Jul 25 '14 at 06:45
  • @Claudix - Ok but i want this – Sudharsan S Jul 25 '14 at 06:46
  • 1
    @Sudharsan In the linked question, OP want to open the console while user is clicking on a link, you are trying to do that while user is pressing a key. Both are coming under same category right. And it does make sense. – Rajaprabhu Aravindasamy Jul 25 '14 at 06:46

2 Answers2

4

You can't press functional keys via javascript. I think we can trigger using .trigger() but can't get the same feature as pressing F12!

jQuery.trigger({ type: 'keypress', which: '123'}); // 123 for F12
John
  • 889
  • 8
  • 16
2

No you can not do this. as it is attached with browser and not with page. JS holds the power to communicate with page and making network calls. Not with browser and other events on machine.

Milind Anantwar
  • 81,290
  • 25
  • 94
  • 125