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

143
Views
How can i Redirect Chrome/Firefox Extension with same opened tab if we click on same URL again?

I'm trying to create Firefox extension to redirect to new tab when clicked on any URL or button and also to Redirect with same opened tab if we click on same URL again

Example: If i click on Link tag, its opens to new tab using window.open('https://example.com', 'child-window');

I want to redirect to the same tab if already have open previously else it should open in new tab.

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

0

U can create your Own window using window.open and check using if and else

<body>

<button onclick="openRequestedPopup('https://stackoverflow.com/')">Home</button>

<button onclick="openRequestedPopup('https://stackoverflow.com/questions/tagged/javascript')">Your Question </button>

 <script>
var pre = '';
function openRequestedPopup(url) {
    if (pre !== url) {
        myWindow = window.open(url, "Open", 'left=100,top=100,width=320,height=320');
        pre = url
    }
    else if (myWindow.closed) {
        pre = ''
        openRequestedPopup(url)

    }
    else {
        myWindow.focus();
    }
}
  </script>
</body>

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!