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

93
Views
Detect URL change and process declarativeNetRequest

I've made a chrome extension that uses an allow list of urls that you can visit, defined in extension option, if not your are redirected to a defined page.

I use declarativeNetRequest rules to handle the allow list.

So let say I only allow the site example.com and when visting any other site it will send me back to example.com, this works for most sites but some sites doesn't reload the page just change the DOM and alter the URL so the declarativeNetRequest isn't "firing". So can you detect the URL change and have it process the DynamicRules?

0:
action:
redirect: {url: 'https://example.com'}
type: "redirect"
condition:
isUrlFilterCaseSensitive: false
regexFilter: "^http"
resourceTypes: ['main_frame']

1:
action:
type: "allow"
condition:
isUrlFilterCaseSensitive: false
regexFilter: "^(?:[a-z0-9-_]+://)?(?:www.)?example.com(?:$|/.*$)"
resourceTypes: ['main_frame']

Example page I found is www.svt.se

about 4 years ago · Juan Pablo Isaza
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!