if(Debug.debug){ console.log("\n\n\n\n\n\n ——— Sᴛλʀᴛɪɴɢ Uʟᴛʀᴀᴡɪᴅɪꜰʏ ———\n << ʟᴏᴀᴅɪɴɢ ᴍᴀɪɴ ꜰɪʟᴇ >>\n\n\n\n"); try { if(window.self !== window.top){ console.log("%cWe aren't in an iframe.", "color: #afc, background: #174"); } else{ console.log("%cWe are in an iframe!", "color: #fea, background: #d31", window.self, window.top); } } catch (e) { console.log("%cWe are in an iframe!", "color: #fea, background: #d31"); } } async function init(){ if(Debug.debug) console.log("[uw::main] loading configuration ..."); // load settings var isSlave = true; await Settings.init(isSlave); // za sporočilca poslušamo v vsakem primeru, tudi če je razširitev na spletnem mestu onemogočena // we listen for messages in any case, even if extension is disabled on current site. browser.runtime.onMessage.addListener(receiveMessage); await SitesConf.init(); // če je trenutno mesto onemogočeno, potem zaključimo na tem mestu // if current site is disabled, we quit here if(! SitesConf.isEnabled(window.location.hostname)){ if(Debug.debug) console.log("[uw:main] | site", window.location.hostname, "is blacklisted."); return; } await Keybinds.init(); if(Debug.debug) console.log("[uw::main] configuration should be loaded now"); // setup the extension setup(); } var pageInfo; async function setup(){ pageInfo = new PageInfo(); if(Debug.debug){ console.log("[uw.js::setup] pageInfo initialized. Here's the object:", pageInfo); } // if(ExtensionConf.arDetect.mode == "blacklist"){ // if(Debug.debug) // console.log("[uw::main] Aspect ratio detection is enabled (mode=",ExtensionConf.arDetect.mode,"). Starting ArDetect"); // ArDetect.arSetup(); // } // else{ // if(Debug.debug) // console.log("[uw::main] Aspect ratio detection is disabled. Mode:", ExtensionConf.arDetect.mode); // } } // tukaj gledamo, ali se je velikost predvajalnika spremenila. Če se je, ponovno prožimo resizer // here we check (in the most ghetto way) whether player size has changed. If it has, we retrigger resizer. // var _video_recheck_counter = 5; // var _video_recheck_period = 1; // on this many retries // function ghettoOnChange(){ // if(_video_recheck_counter++ > _video_recheck_period){ // _video_recheck_counter = 0; // if ( GlobalVars.video == null || // GlobalVars.video == undefined || // GlobalVars.video.videoWidth == 0 || // GlobalVars.video.videoHeight == 0 ){ // var video = document.getElementsByTagName("video")[0]; // if ( video !== undefined && // video !== null && // video.videoWidth > 0 && // video.videoHeight > 0 ){ // if(Debug.debug){ // console.log("%c[uw::ghettoOnChange] detected video. registering!", "color: #99f, background: #000"); // console.log("[uw::ghettoOnChange] just for shits and giggles, let's see what's happened with GlobalVars.playerDimensions:", GlobalVars.playerDimensions) // } // // zaznali smo novo