📜  通过扩展注入模态页面 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:28.476000             🧑  作者: Mango

代码示例2
fetch(chrome.extension.getURL('/modal.html'))
    .then(response => response.text())
    .then(data => {
        document.getElementById('inject-container').innerHTML = data;
        // other code
        // eg update injected elements,
        // add event listeners or logic to connect to other parts of the app
    }).catch(err => {
        // handle error
    });