electron/spec/fixtures/extensions/lazy-background-page/content_script.js

7 lines
317 B
JavaScript
Raw Normal View History

/* eslint-disable no-undef */
chrome.runtime.sendMessage({ some: 'message' }, (response) => {
2020-03-20 20:28:31 +00:00
const script = document.createElement('script');
script.textContent = `require('electron').ipcRenderer.send('bg-page-message-response', ${JSON.stringify(response)})`;
document.documentElement.appendChild(script);
});