Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

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
    });
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #inject #modal #page #extension
ADD COMMENT
Topic
Name
8+5 =