Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

199
Views
Javascript: Open popup window in Chrome with hotkey

I am trying to write a window popup function, so whenever person types character v in Chrome, it will open popup. The following is not working, I type "v" on keyboard, and no popup window opens. How can I fix this? Using this in F12 Console to write the function.

function doc_keyUp(e) {
    if (e.keyCode == 86) {
       alert("Test!");
    }
}

Resource Hotkey: https://keycode.info/

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Try it:

window.addEventListener("keydown", e => {
    if ( e.keyCode == 86 ) {
        //window.open("url")
    }
});
about 4 years ago · Juan Pablo Isaza Report

0

Use keyCode Search to get correct keyCode

demo page

window.addEventListener("keyup", function(e) {
    if ( e.keyCode == 86 ) {
        window.open('http://www.google.com','GoogleWindow', 'width=800, height=600');
    }
});
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!