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

112
Views
Firefox blocks Greasemonkey script that opens links with delay

I have a webpage with a series of links. I installed Greasemonkey script to click on each with a delay but Firefox blocks after only a few even though I have disabled the "Block Popups" option.

And they are not really popups anyway but just tabs, i.e complete pages.

the Greasemonkey script is

// ==UserScript==
// @name     AlbunackSubmitArtistLinksOnPage
// @version  1
// @grant    none
// @include  http://reports.albunack.net/mbartist_discogsartist_report2*.html
// ==/UserScript==

function delayedOpenLink(link)
{
    link.click();  
}

function check()
{
  var links = document.getElementsByName("link");
  var i=1;
  for(link of links)
  {
    setTimeout(delayedOpenLink, 5000 * i, link);
    i++;
  }
}

setTimeout(check, 5000);

This is frustrating because it's my webpage and put a delay between each tab opening and I have disabled the popup blocking so why is Firefox still blocking my tabs

Also, I get a message saying Firefox prevented x Popups from opening but if you click on it there is only one option to open each one one by one, block popups, or manage popups (but they are already unblocked), but no option to allow popups.

Increasing delay from 5 seconds (5000) to 20 seconds (20000) allowed a few more to go through but not many more.

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

0

The issue seems to be the number of tabs opened rather than the number of links opened. By this I mean that if I change the link to reuse the same tab with target="secondpage" instead of opening in a new tab with target="_blank" then Firefox doesn't complain.

I can only do this because when I open the link a Greasemonkey script kicks in and submits the page on the tab, so I no longer need the page. But I have to make sure there is enough time between opening each link for the Greasemonkey script to complete before the next link is opened.

about 4 years ago · Juan Pablo Isaza Report

0

How about GM_openInTab?

// ==UserScript==
// @name     AlbunackSubmitArtistLinksOnPage
// @version  1
// @grant    GM_openInTab
// @include  http://reports.albunack.net/mbartist_discogsartist_report2*.html
// ==/UserScript==

const delay = seconds => new Promise(resolve => setTimeout(resolve, seconds * 1e3));

async function check()
{
  const links = document.getElementsByName("link");

  for (const link of links) {
    await delay(5);
    GM_openInTab(link.href);
  }
}

setTimeout(check, 5000); // or check()

This will click every link on the page every 5 seconds. There are also some other improvements to your original script (const instead of var, async/await).

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!