diff --git a/js/conf/Debug.js b/js/conf/Debug.js index 3cefbc7..a9092c5 100644 --- a/js/conf/Debug.js +++ b/js/conf/Debug.js @@ -6,7 +6,7 @@ Debug = { debug: true, keyboard: true, debugResizer: true, - debugArDetect: false, + debugArDetect: true, debugStorage: true, showArDetectCanvas: true, flushStoredSettings: false, diff --git a/js/conf/SitesConf.js b/js/conf/SitesConf.js index df96bea..d52fd51 100644 --- a/js/conf/SitesConf.js +++ b/js/conf/SitesConf.js @@ -203,7 +203,8 @@ var _sc_arStatus = function(site){ var _sc_siteEnableEmbedded = function(site) { if( _sc_sites[site] == undefined || _sc_sites[site].statusEmbedded == "follow-global" ){ - console.log(".... this site is undefined! er"); + if(Debug.debug) + console.log("[SitesConf::_sc_siteEnableEmbedded] site", site, "is not defined in settings."); if(ExtensionConf.extensionMode == "blacklist" ){ return true; diff --git a/js/modules/ArDetect.js b/js/modules/ArDetect.js index eeb0d10..396ca44 100644 --- a/js/modules/ArDetect.js +++ b/js/modules/ArDetect.js @@ -304,6 +304,7 @@ var _ard_vdraw_but_for_reals = function() { if(GlobalVars.video == null || GlobalVars.video.ended || Status.arStrat != "auto"){ // we slow down if ended, null, or not auto. Detecting is pointless. + _ard_vdraw(ExtensionConf.arDetect.timer_paused); return false; } @@ -314,6 +315,7 @@ var _ard_vdraw_but_for_reals = function() { } + try{ GlobalVars.canvas.context.drawImage(GlobalVars.video, 0,0, GlobalVars.canvas.width, GlobalVars.canvas.height); } @@ -425,7 +427,7 @@ var _ard_vdraw_but_for_reals = function() { if(Debug.debug){ console.log("%c[ArDetect::_ard_vdraw] no edge detected. canvas has no edge.", "color: #aaf"); } - + image = null; // Pogledamo, ali smo že kdaj ponastavili CSS. Če še nismo, potem to storimo. Če smo že, potem ne. @@ -475,6 +477,7 @@ var _ard_vdraw_but_for_reals = function() { // če sta obe funkciji uspeli, potem se razmerje stranic ni spremenilo. // if both succeed, then aspect ratio hasn't changed. if(imageDetectResult && guardLineResult){ + delete image; triggerTimeout = _ard_getTimeout(baseTimeout, startTime); _ard_vdraw(triggerTimeout); //no letterbox, no problem @@ -492,7 +495,7 @@ var _ard_vdraw_but_for_reals = function() { var edgeCandidates = _ard_edgeDetect(image, blackbarSamples); var edgePost = _ard_edgePostprocess(edgeCandidates, GlobalVars.canvas.height); -// console.log("SAMPLES:", blackbarSamples, "candidates:", edgeCandidates, "post:", edgePost,"\n\nblack level:",GlobalVars.arDetect.blackLevel, "tresh:", GlobalVars.arDetect.blackLevel + ExtensionConf.arDetect.blackbarTreshold); + console.log("SAMPLES:", blackbarSamples, "candidates:", edgeCandidates, "post:", edgePost,"\n\nblack level:",GlobalVars.arDetect.blackLevel, "tresh:", GlobalVars.arDetect.blackLevel + ExtensionConf.arDetect.blackbarTreshold); if(edgePost.status == "ar_known"){ _ard_processAr(GlobalVars.video, GlobalVars.canvas.width, GlobalVars.canvas.height, edgePost.blackbarWidth, null, fallbackMode); @@ -838,6 +841,8 @@ var _ard_findBlackbarLimits = function(image, cols, guardLineResult, imageDetect if( image[tmpI] > blackbarTreshold || image[tmpI + 1] > blackbarTreshold || image[tmpI + 2] > blackbarTreshold ){ + console.log("pushing to res_top"); + res_top.push({ col: col, top: (i / GlobalVars.canvas.imageDataRowLength) - 1 @@ -854,10 +859,12 @@ var _ard_findBlackbarLimits = function(image, cols, guardLineResult, imageDetect for(var col of cols_b){ tmpI = i + (col * 4); - if( image[tmpI] > blackbarTreshold || image[tmpI + 1] > blackbarTreshold || image[tmpI + 2] > blackbarTreshold ){ + + console.log("pushing to res_bottom"); + var bottom = (i / GlobalVars.canvas.imageDataRowLength) + 1; res_bottom.push({ col: col, @@ -881,7 +888,6 @@ var _ard_guardLineImageDetect = function(image){ var blackbarTreshold = GlobalVars.arDetect.blackLevel + ExtensionConf.arDetect.blackbarTreshold; var edges = GlobalVars.arDetect.guardLine; - var offset = parseInt(GlobalVars.canvas.width * ExtensionConf.arDetect.guardLine.ignoreEdgeMargin) * 4; // TODO: implement logo check. diff --git a/js/uw-bg.js b/js/uw-bg.js index b93d7ac..afad743 100644 --- a/js/uw-bg.js +++ b/js/uw-bg.js @@ -161,10 +161,15 @@ function _uwbg_rcvmsg(message, sender, sendResponse){ config.arConf.enabled_current = ExtensionConf.arDetect.enabled == "blacklist"; var res = {response: config} + + if(Debug.debug){ + console.log("[uw-bg::_uwbg_rcvmsg] get-config: returning this to popup script:", res); + } + if(BrowserDetect.firefox){ return Promise.resolve(res); } - sendMessage(res); + sendResponse(res); return true; } @@ -221,7 +226,7 @@ function _uwbg_rcvmsg(message, sender, sendResponse){ return Promise.resolve({response: ExtensionConf}); try{ - sendResponse({response: mode}); + sendResponse({response: ExtensionConf}); } catch(chromeIsShitError){}; diff --git a/manifest.json b/manifest.json index 425e7c8..274f53f 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "Ultrawidify", - "version": "2.2.0", + "version": "2.2.1", "icons": { "32":"res/icons/uw-32.png", diff --git a/res/css/font/overpass-mono.css b/res/css/font/overpass-mono.css index 476d9c4..81be909 100644 --- a/res/css/font/overpass-mono.css +++ b/res/css/font/overpass-mono.css @@ -1,20 +1,20 @@ @font-face { font-family: 'overpass-mono'; - src: url('overpass-mono-light.woff2') format('woff2'), + src: url('../../fonts/overpass-mono-webfont/overpass-mono-light.woff2') format('woff2'), font-weight: 300; font-style: normal; } @font-face { font-family: 'overpass-mono'; - src: url('overpass-mono-regular.woff2') format('woff2'), + src: url('../../fonts/overpass-mono-webfont/overpass-mono-regular.woff2') format('woff2'), font-weight: 400; font-style: normal; } @font-face { font-family: 'overpass-mono'; - src: url('overpass-mono-semibold.woff2') format('woff2'), + src: url('../../fonts/overpass-mono-webfont/overpass-mono-semibold.woff2') format('woff2'), font-weight: 500; font-style: normal; } @@ -23,7 +23,7 @@ @font-face { font-family: 'overpass-mono'; - src: url('overpass-mono-bold.woff2') format('woff2'), + src: url('../../fonts/overpass-mono-webfont/overpass-mono-bold.woff2') format('woff2'), font-weight: 600; font-style: normal; } diff --git a/res/css/font/overpass.css b/res/css/font/overpass.css index 98cedc7..f75c047 100644 --- a/res/css/font/overpass.css +++ b/res/css/font/overpass.css @@ -1,13 +1,13 @@ @font-face { font-family: 'overpass'; - src: url('overpass-thin.woff2') format('woff2'), /* Super Modern Browsers */ + src: url('../../fonts/overpass-webfont/overpass-thin.woff2') format('woff2'), /* Super Modern Browsers */ font-weight: 200; font-style: normal; } @font-face { font-family: 'overpass'; - src: url('overpass-thin-italic.woff2') format('woff2'), + src: url('../../fonts/overpass-webfont/overpass-thin-italic.woff2') format('woff2'), font-weight: 200; font-style: italic; } @@ -15,14 +15,14 @@ @font-face { font-family: 'overpass'; - src: url('overpass-extralight.woff2') format('woff2'), + src: url('../../fonts/overpass-webfont/overpass-extralight.woff2') format('woff2'), font-weight: 300; font-style: normal; } @font-face { font-family: 'overpass'; - src: url('overpass-extralight-italic.woff2') format('woff2'), + src: url('../../fonts/overpass-webfont/overpass-extralight-italic.woff2') format('woff2'), font-weight: 300; font-style: italic; } @@ -31,14 +31,14 @@ @font-face { font-family: 'overpass'; - src: url('overpass-light.woff2') format('woff2'), + src: url('../../fonts/overpass-webfont/overpass-light.woff2') format('woff2'), font-weight: 400; font-style: normal; } @font-face { font-family: 'overpass'; - src: url('overpass-light-italic.woff2') format('woff2'), + src: url('../../fonts/overpass-webfont/overpass-light-italic.woff2') format('woff2'), font-weight: 400; font-style: italic; } @@ -47,14 +47,14 @@ @font-face { font-family: 'overpass'; - src: url('overpass-regular.woff2') format('woff2'), + src: url('../../fonts/overpass-webfont/overpass-regular.woff2') format('woff2'), font-weight: 500; font-style: normal; } @font-face { font-family: 'overpass'; - src: url('overpass-italic.woff2') format('woff2'), + src: url('../../fonts/overpass-webfont/overpass-italic.woff2') format('woff2'), font-weight: 500; font-style: italic; } @@ -64,14 +64,14 @@ @font-face { font-family: 'overpass'; - src: url('overpass-semibold.woff2') format('woff2'), + src: url('../../fonts/overpass-webfont/overpass-semibold.woff2') format('woff2'), font-weight: 600; font-style: normal; } @font-face { font-family: 'overpass'; - src: url('overpass-semibold-italic.woff2') format('woff2'), + src: url('../../fonts/overpass-webfont/overpass-semibold-italic.woff2') format('woff2'), font-weight: 600; font-style: italic; } @@ -81,14 +81,14 @@ @font-face { font-family: 'overpass'; - src: url('overpass-bold.woff2') format('woff2'), + src: url('../../fonts/overpass-webfont/overpass-bold.woff2') format('woff2'), font-weight: 700; font-style: normal; } @font-face { font-family: 'overpass'; - src: url('overpass-bold-italic.woff2') format('woff2'), + src: url('../../fonts/overpass-webfont/overpass-bold-italic.woff2') format('woff2'), font-weight: 700; font-style: italic; } @@ -97,14 +97,14 @@ @font-face { font-family: 'overpass'; - src: url('overpass-extrabold.woff2') format('woff2'), + src: url('../../fonts/overpass-webfont/overpass-extrabold.woff2') format('woff2'), font-weight: 800; font-style: normal; } @font-face { font-family: 'overpass'; - src: url('overpass-extrabold-italic.woff2') format('woff2'), + src: url('../../fonts/overpass-webfont/overpass-extrabold-italic.woff2') format('woff2'), font-weight: 800; font-style: italic; } @@ -112,14 +112,14 @@ @font-face { font-family: 'overpass'; - src: url('overpass-heavy.woff2') format('woff2'), + src: url('../../fonts/overpass-webfont/overpass-heavy.woff2') format('woff2'), font-weight: 900; font-style: normal; } @font-face { font-family: 'overpass'; - src: url('overpass-heavy-italic.woff2') format('woff2'), + src: url('../../fonts/overpass-webfont/overpass-heavy-italic.woff2') format('woff2'), font-weight: 900; font-style: italic; } diff --git a/res/popup/js/popup.js b/res/popup/js/popup.js index 2e0585c..f8239ba 100644 --- a/res/popup/js/popup.js +++ b/res/popup/js/popup.js @@ -102,7 +102,7 @@ function check4conf(){ Comms.sendToBackgroundScript({cmd: "get-config"}) .then(response => { if(Debug.debug) - console.log("[popup.js::check4conf] received response:",response, response.response); + console.log("[popup.js::check4conf] received response to get-config request:",response, response.response); loadConfig(response.response); }) @@ -177,8 +177,6 @@ function loadConfig(config){ document.getElementById("_checkbox_autoArEnabled").checked = config.arMode == "blacklist"; - console.log("how do I checked? arMode:", config.arMode, " -- is equal to blacklist?", config.arMode == "blacklist"); - document.getElementById("_input_autoAr_frequency").value = parseInt(1000/config.arTimerPlaying); // process video alignment: @@ -437,7 +435,7 @@ document.addEventListener("click", (e) => { else{ Comms.sendToAll({cmd: "enable-autoar", sender: "popup", receiver: "uwbg"}); Comms.sendToBackgroundScript({cmd: "enable-autoar", sender: "popup", receiver: "uwbg"}); - Comms.sendToAll({cmd: "force-ar", newAr: "auto", sender: "popup", receiver: "uwbg"}); + Comms.sendToAll({cmd: "force-ar", newAr: "auto", arType: "legacy", sender: "popup", receiver: "uwbg"}); } return; } diff --git a/res/popup/popup.html b/res/popup/popup.html index a59f8b1..7a977d2 100644 --- a/res/popup/popup.html +++ b/res/popup/popup.html @@ -13,7 +13,7 @@ /* width: 100%; */ color: #f8f8f8; background-color: #1f1f1f; - font-family: "Overpass"; + font-family: "Overpass", "overpass"; font-size: 1em; }