2017-11-13 01:23:39 -05:00
|
|
|
/* eslint strict: off */
|
|
|
|
'use strict';
|
|
|
|
(() => {
|
2017-11-14 04:02:34 -05:00
|
|
|
// Don't run on certain sub-domains.
|
2022-10-07 15:12:15 -04:00
|
|
|
if ( /^(?:localhost\.rig|blog|im|chatdepot|tmi|api|brand|dev|gql|passport)\./.test(location.hostname) )
|
2017-11-13 01:23:39 -05:00
|
|
|
return;
|
|
|
|
|
2021-02-12 15:27:12 -05:00
|
|
|
const DEBUG = localStorage.ffzDebugMode == 'true' && document.body.classList.contains('ffz-dev'),
|
2021-03-02 16:55:25 -05:00
|
|
|
HOST = location.hostname,
|
2022-03-23 14:10:25 -04:00
|
|
|
SERVER = DEBUG ? '//localhost:8000' : '//cdn.frankerfacez.com',
|
|
|
|
script = document.createElement('script');
|
|
|
|
|
|
|
|
let FLAVOR =
|
2021-03-02 16:55:25 -05:00
|
|
|
HOST.includes('player') ? 'player' :
|
|
|
|
HOST.includes('clips') ? 'clips' :
|
2022-03-23 14:10:25 -04:00
|
|
|
(location.pathname === '/p/ffz_bridge/' ? 'bridge' : 'avalon');
|
2017-11-13 01:23:39 -05:00
|
|
|
|
2022-03-23 14:10:25 -04:00
|
|
|
if (FLAVOR === 'clips' && location.pathname === '/embed')
|
|
|
|
FLAVOR = 'player';
|
2017-11-13 01:23:39 -05:00
|
|
|
|
|
|
|
script.id = 'ffz-script';
|
2018-04-28 17:56:03 -04:00
|
|
|
script.async = true;
|
2018-04-15 17:19:22 -04:00
|
|
|
script.crossOrigin = 'anonymous';
|
2021-03-02 16:55:25 -05:00
|
|
|
script.src = `${SERVER}/script/${FLAVOR}.js?_=${Date.now()}`;
|
2017-11-13 01:23:39 -05:00
|
|
|
document.head.appendChild(script);
|
|
|
|
})();
|