2023-05-19 15:02:25 -04:00
|
|
|
/* 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) )
|
|
|
|
return;
|
|
|
|
|
|
|
|
const HOST = location.hostname,
|
2023-09-07 14:05:10 -04:00
|
|
|
SERVER = browser.runtime.getURL("web"),
|
2023-05-19 15:02:25 -04:00
|
|
|
script = document.createElement('script');
|
|
|
|
|
|
|
|
let FLAVOR =
|
|
|
|
HOST.includes('player') ? 'player' :
|
|
|
|
HOST.includes('clips') ? 'clips' :
|
|
|
|
(location.pathname === '/p/ffz_bridge/' ? 'bridge' : 'avalon');
|
|
|
|
|
|
|
|
if (FLAVOR === 'clips' && location.pathname === '/embed')
|
|
|
|
FLAVOR = 'player';
|
|
|
|
|
|
|
|
script.id = 'ffz-script';
|
|
|
|
script.async = true;
|
|
|
|
script.crossOrigin = 'anonymous';
|
|
|
|
script.src = `${SERVER}/${FLAVOR}.js?_=${Date.now()}`;
|
2023-09-01 17:01:52 -04:00
|
|
|
script.dataset.path = SERVER;
|
2023-09-07 14:05:10 -04:00
|
|
|
|
2023-05-19 15:02:25 -04:00
|
|
|
document.head.appendChild(script);
|
|
|
|
})();
|