1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-13 01:20:54 +00:00
* Added: Setting to use native styling for subscription notices in chat. (Closes #1551)
* Added: Setting to hide the stories UI in the side navigation. (Closes #1531)
* Added: Setting to hide specific users from the directory and sidebar.
* Changed: Hide the top navigation's search field when using minimal navigation for a cleaner look. (Closes #1556)
* Changed: More internal changes for the support to Manifest v3.
* Fixed: Uploading logs from the FFZ Control Center not working.
* API Changed: Removed support for `no_sanitize` from `setChildren`. I don't think anything was currently using this, but going forward it is unsupported. We want to avoid using `innerHTML` as much as possible to simplify the approval process.
This commit is contained in:
SirStendec 2024-10-09 17:09:09 -04:00
parent 533bf52c9e
commit 1ee737f2ca
17 changed files with 669 additions and 280 deletions

View file

@ -1,16 +1,52 @@
/* eslint strict: off */
'use strict';
(() => {
// Don't run on certain sub-domains.
if ( /^(?:localhost\.rig|blog|im|chatdepot|tmi|api|brand|dev|gql|passport)\./.test(location.hostname) )
const browser = globalThis.browser ?? globalThis.chrome;
if (
// Don't run on certain sub-domains.
/^(?:localhost\.rig|blog|im|chatdepot|tmi|api|brand|dev|gql|passport)\./.test(location.hostname)
||
// Don't run on pages that have disabled FFZ.
/disable_frankerfacez/.test(location.search)
) {
// Tell the service worker we aren't injecting.
browser.runtime.sendMessage({
type: 'ffz_not_supported'
});
return;
}
if ( /disable_frankerfacez/.test(location.search) )
return;
// Make sure to wake the service worker up early.
browser.runtime.sendMessage({
type: 'ffz_injecting'
});
const browser = globalThis.browser ?? globalThis.chrome,
// Set up the extension message bridge.
window.addEventListener('message', evt => {
if (evt.source !== window)
return;
HOST = location.hostname,
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
}, '*');
});
});
browser.runtime.onMessage.addListener((msg, sender) => {
window.postMessage({
type: 'ffz_from_ext',
data: msg
}, '*');
return true;
});
// Now, inject our script into the page context.
const HOST = location.hostname,
SERVER = browser.runtime.getURL("web"),
script = document.createElement('script');