📌  相关文章
📜  以 chrome 扩展名导入文件 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:09.077000             🧑  作者: Mango

代码示例1
'use strict';

    const script = document.createElement('script');
    script.setAttribute("type", "module");
    script.setAttribute("src", chrome.extension.getURL('main.js'));
    const head = document.head || document.getElementsByTagName("head")[0] || document.documentElement;
    head.insertBefore(script, head.lastChild);