【问题标题】:Not running at document_start不在 document_start 运行
【发布时间】:2022-11-21 03:50:22
【问题描述】:

我的扩展程序不在 document_start 上运行。清单.json:

{
    "manifest_version": 3,
    "name": "Lift Web Restrictions",
    "description": "Simple extension that removes most ads, web restrictions, adds mods to MooMoo.io / Krunker.io / and more!",
    "version": "0.0.5",
    "icons": {
        "16": "logo/sw16.png",
        "48": "logo/sw48.png",
        "128": "logo/sw128.png"
    },
    "permissions": [],
    "host_permissions": [
        "*://*/*"
    ],
    "background": {
        "service_worker": "service-worker.js"
    },
    "web_accessible_resources": [
        {
          "resources": ["modules/script.js"],
          "matches": ["*://*/*"]
        }
    ],     
    "content_scripts": [{
        "js": [
            "modules/transfer.js"
        ],
        "matches": ["http://*/*", "https://*/*"],
        "all_frames": true,
        "run-at": "document_start"
    }]
}

modules/transfer.js 中有一个 console.log,但是页面的脚本标记胜过它。

Launching egAps
index.bf049c93.js?52f6f7bb66295262766e:2 Downloading d.js...

index.bf049c93.js?52f6f7bb66295262766e:2 Loading WASM c66eb3cbd8fdc1325900.wasm
^^^^ logged before script runs

index.bf049c93.js?52f6f7bb66295262766e:2 1 dependencies left
transfer.js:1 fireAt <--- where it runs
index.bf049c93.js?52f6f7bb66295262766e:2 0 dependencies left
index.bf049c93.js?52f6f7bb66295262766e:2 Running...
index.bf049c93.js?52f6f7bb66295262766e:2 

【问题讨论】:

  • run-at 替换为 run_at
  • @wOxxOm 你是救命恩人。太感谢了

标签: google-chrome-extension


【解决方案1】:

run-at替换为run_at

谢谢你 wOxxOm

【讨论】:

    猜你喜欢
    • 2015-03-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-30
    • 1970-01-01
    • 2018-12-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多