electron/spec/fixtures/extensions/mv3-service-worker/main.js

14 lines
353 B
JavaScript

/* global chrome */
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
sendResponse(message);
});
window.addEventListener('message', (event) => {
if (event.data === 'fetch-confirmation') {
chrome.runtime.sendMessage('fetch-confirmation', response => {
console.log(JSON.stringify(response));
});
}
}, false);