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

247
Views
My extension for Google Chrome that blocks website, doesn't work on youtube, but on every other website it works

Description

I made this extension for google chrome, which blocks website by keyword and is working perfectly on all websites, but on youtube it doesn't work.

Is there any solution so that my extension works on youtube as well?

background.js

console.log("Loaded extension");



function blockRequest(details) {
   return {cancel: true};
}
function updateFilters(urls) {
   if(chrome.webRequest.onBeforeRequest.hasListener(blockRequest))
     chrome.webRequest.onBeforeRequest.removeListener(blockRequest);
   chrome.webRequest.onBeforeRequest.addListener(blockRequest, {
      urls: [
         "https://*/*"+ "mrbeast*"
         ]
   }, 
   ['blocking']);
}
updateFilters(); 

maninfest.json

{
  "name": "Foco Study",
  "description": "Foco",
  "version": "2.0",
  "permissions": [
     "webRequestBlocking",
     "webRequest",
     "activeTab",
     "tabs",
     "http://*/*",
     "https://*/*",
     "https://www.youtube.com/*"
  ],
  "background" : {
    "scripts":  [
      
      "background.js"
    ],
    "matches": [
      "*://www.youtube.com/*", "http://*/*",
      "https://*/*"
    ]
  },
  "manifest_version": 2
}
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!