Search code examples
javascriptproxygreasemonkeytampermonkey

change ip with tampermonkey or greasemonkey from browser


How does one change IP address using javascript on keyboard shortcut pressed? I am using tampermonkey/firefox.

The code would look something like this:

document.onkeydown = keydown;

function keydown(evt){
  if (!evt) evt = event;
  if (evt.metaKey && evt.keyCode==68){ //CMD+d
      // change IP address here, possibly using proxys or some other way

  }

}

Solution

  • I'm pretty sure that this isn't possible. It is beyond JavaScript's capabilities to change an IP adress. (see this webpage for more info).

    To do this you would need to use something like C++. JavaScript doesn't have the ability to communicate with the wireless router.