1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-13 01:20:54 +00:00
* Fixed: Bug in the sidebar processing code that may log errors when combined with other add-ons.
* API Changed: Improve messaging for manifest v3 extension mode.
This commit is contained in:
SirStendec 2024-10-11 17:12:54 -04:00
parent 431fa8f3a3
commit 5c06461a0e
4 changed files with 8 additions and 13 deletions

View file

@ -29,20 +29,16 @@
if (evt.data && evt.data.type === 'ffz_to_ext')
browser.runtime.sendMessage(evt.data.data, resp => {
if (resp)
window.postMessage({
type: 'ffz_from_ext',
data: resp
}, '*');
if (resp?.type === 'ffz_to_page')
window.postMessage(resp.data, '*');
});
});
browser.runtime.onMessage.addListener((msg, sender) => {
window.postMessage({
type: 'ffz_from_ext',
data: msg
}, '*');
return true;
if (msg?.type === 'ffz_to_page')
window.postMessage(msg.data, '*');
return false;
});
// Now, inject our script into the page context.