【发布时间】:2022-11-26 19:57:33
【问题描述】:
在我的扩展中,我动态地注入了一个内容脚本。内容脚本是
let txt = fetch(chrome.runtime.getURL('example.txt')).then(r=>r.text());
我得到的错误是GET chrome-extension://invalid/ net::ERR_FAILED (anonymous) @ content-script.js:36。
在我的研究中,我找到了 https://developer.chrome.com/docs/extensions/mv3/manifest/web_accessible_resources/ 页面,该页面讨论了一些脚本如何获得被拒绝的资源。但它说内容脚本不受影响。
问题是什么? 文档错了吗?
【问题讨论】:
标签: google-chrome-extension content-script chrome-extension-manifest-v3