1fetch(chrome.extension.getURL('/modal.html'))
2 .then(response => response.text())
3 .then(data => {
4 document.getElementById('inject-container').innerHTML = data;
5 // other code
6 // eg update injected elements,
7 // add event listeners or logic to connect to other parts of the app
8 }).catch(err => {
9 // handle error
10 });
11