Open pixelmord opened 4 years ago
// content-scipt.js const i = document.createElement('iframe') const b = document.createElement('button') const p = document.getElementById('some-id') b.innerHTML = 'Open' b.addEventListener('click', (evt) => { evt.preventDefault() chrome.runtime.sendMessage({ open: true }, (response) => { i.src = response p.appendChild(i) }) }) p.appendChild(b)
This opens the extension in the DOM of the page the script is running on. You will also need to add the below to the manifest.
// manifest.json .... "web_accessible_resources": [ "popup.html" ] ....
May be helpful
This opens the extension in the DOM of the page the script is running on. You will also need to add the below to the manifest.