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

149
Views
How to run specific script for particular website and general script for other websites

This question is completely different from match-all-urls-except-certain-urls-in-chrome-extension. This question is to run a specific script on the website rather than excluding it completely.

I am developing a chrome extension that requires a specific javascript file for 1 site. Another javascript file for all the other websites.

Here is my manifest.json file.

{
    "name": "See World Colourful",
    "version": "0.0.1",
    "manifest_version": 2,
    "icons": {
        "128": "logo.png"
    },
    "page_action": {
        "default_popup": "popup.html",
        "default_icon": "logo.png",
        "default_title": "SeeWorldColourful"
    },
    "background": {
        "scripts": ["eventPage.js"],
        "persistent": false
    },
    "content_scripts": [
        {
            "matches": ["https://www.geeksforgeeks.org/*"],
            "js": ["contentGFG.js", "jquery-3.6.0.js"]
        },
        {
            "matches": ["https://*/*"],
            "js": ["contentAll.js", "jquery-3.6.0.js"]
        }
    ],
    "permissions": [
        "activeTab", 
        "tabs", 
        "storage",
        "contextMenus",
        "https://www.geeksforgeeks.org/*",
        "https://*/*"
    ]
}

I was trying to run the contentGFG.js script on geeksforgeeks website and the contentAll.js script for all the other websites but, contentAll.js runs on all the websites including geeksforgeeks.

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!