S
S
Sedbol2019-07-12 07:29:11
Browser extensions
Sedbol, 2019-07-12 07:29:11

How to run a script only on a specific address?

How to run a script only at the specified address?

{
"manifest_version":2,
"name":"game love",
"version":"1.0",

"icons":{
"64":"favicon1.png"},

"content_scripts":[
{
"matches":["*://*/*"],
"js":["com.js"]
}
],
"permissions":["https://site.com/ping1"]

The script runs on the entire site.com site.
How can I make it run only on a specific address? https://site.com/ping1 only on this excluding all addresses of this site?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vaflya, 2019-07-17
@Sedbol

// Скрипты отвечающие за модификацию страниц сайтов
    "content_scripts": [
     {
        "js": [
            "/js/jquery-3.3.1.min.js",
            "/js/content_script.js"
        ],
        "run_at": "document_start",
        // Адреса страниц на котрых запускается фоновый скрипт
        "matches": [
            " https://site.com/ping1",
        ],
        "all_frames": true
     }
    ],

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question