inject modal to page through extension
"web_accessible_resources": [
"modal.html",
],
3.33
6
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
});
Thank you!
6
0
Are there any code examples left?
New code examples in category Other