initial 0.1.0 commit
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
// Test-only content script: forwards page messages to the background hook.
|
||||
// Injected by build-test-extension.sh into the fixture pages only.
|
||||
window.addEventListener('message', event => {
|
||||
if (event.source !== window || !event.data || event.data.tuTest !== true) return;
|
||||
const { id, cmd, tabId, values, value, tabs, skipAudible } = event.data;
|
||||
browser.runtime.sendMessage({ type: 'tu-test', cmd, tabId, values, value, tabs, skipAudible }).then(
|
||||
value => window.postMessage({ tuResult: id, value }, '*'),
|
||||
error => window.postMessage({ tuResult: id, error: String(error) }, '*')
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user