Chrome kinda works according to 1 beta tester. Fixed few other chrome-specific bugs I've noticed. Fixed the font inclusion (hopefully)

This commit is contained in:
Tamius Han 2018-03-14 21:19:15 +01:00
parent 3b7f00dc8e
commit c35774c36f
9 changed files with 44 additions and 34 deletions

View File

@ -6,7 +6,7 @@ Debug = {
debug: true,
keyboard: true,
debugResizer: true,
debugArDetect: false,
debugArDetect: true,
debugStorage: true,
showArDetectCanvas: true,
flushStoredSettings: false,

View File

@ -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;

View File

@ -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.

View File

@ -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){};

View File

@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Ultrawidify",
"version": "2.2.0",
"version": "2.2.1",
"icons": {
"32":"res/icons/uw-32.png",

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -13,7 +13,7 @@
/* width: 100%; */
color: #f8f8f8;
background-color: #1f1f1f;
font-family: "Overpass";
font-family: "Overpass", "overpass";
font-size: 1em;
}