Answers for "inject modal to page through extension"

0

inject modal to page through extension

"web_accessible_resources": [
    "modal.html",
],
Posted by: Guest on January-05-2021
0

inject modal to page through extension

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
    });
Posted by: Guest on January-05-2021

Browse Popular Code Answers by Language