diff --git a/README.md b/README.md index e0bcb8f..8edd3ca 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,12 @@ Manually triggering aspect ratio change will suspend automatic aspect ratio dete ## Changelog +### v2.1.2 + +* Fixed some bugs with autodetection sometimes not working properly on Youtube. + +Problem: there's this bit of code that keeps aspect ratio from changing when the difference between 'previous' and 'current' aspect ratio is too small. Unfortunately, the 'previous' value was _not_ updated on every aspect ratio switch for some reason. Also `ArDetect.init()` — for some reason — didn't always clean the 'previous' value even though it should. + ### v2.1.1 (FF/Amo) * Fixed issue #20 — aspect ratio autodetection should now start on subsequent videos as well. diff --git a/buildext.sh b/buildext.sh deleted file mode 100755 index c674bb5..0000000 --- a/buildext.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash - -# Takes all the files from 'src' and compiles it intro a single content script. -# Also compiles background scripts and settings pages. -# -# I'm using this over something like requirejs so my extension doesn't need even more -# dependencies. -# -# How does this work? -# 0. You're supposed to run this in the root directory of the extension. - -# 1. see if file has any #include [filename] comments. If so, merge [filename] file -# into the current file (after checking if that file has any #include comments -# Compiled files are saved to /tmp. -# -# 2. After compiling file and its dependencies, check for presence of #location [directory] -# comments. [directory] is relative to the root directory of the extension -# 2.1 also check for #out, which defines filename. -# -# 3. Use '-nodebug' to remove all calls of console.log (to be implemented) - -function flattenFileName { - echo $1 | sed 's/\//_/g' -} - -fileList=""; - -function compileFile { - local file=$1 - local flatfile=$(flattenFileName $file); - - - if [ -f /tmp/$flatfile ] ; then - return 0 - fi; - - fileList="$fileList $flatfile" - - # let's take all the #included files and put them at the top - for f in $(grep "#include" $file | awk '{print $NF}') ; do - - local lf=$f - fflat=$(flattenFileName $lf); - - compileFile $lf - - printf "\n//BEGIN included from $lf\n" >> /tmp/$flatfile - grep -Ev "#include|#location|#out" /tmp/$fflat >> /tmp/$flatfile - printf "//END included from $lf\n\n" >> /tmp/$flatfile - - done - - grep -Ev "#include|#location|#out" $file >> /tmp/$flatfile -} - -cd src; - -for file in *.js ; do - echo "main loop, we're looking at this file: $file" - compileFile $file - echo "Files compiled. Moving to location (if specified)" - - outFile=$file - - if grep -q "#out" $file ; then - outFile=$( grep "#out" $file | awk '{print $NF}') - fi - - - - if grep -q "#location" $file ; then - location=$( grep "#location" $file | awk '{print $NF}') - echo "File will be saved to $location as $outFile" - cd .. - echo "// Autogenerated using buildext. This file should not be modified — modify source files instead." > $location/$outFile - grep -Ev "#location|#include|#out" /tmp/$(flattenFileName $file) >> $location/$outFile - cd src - fi -done - -# perform cleanup -for file in $fileList ; do - rm /tmp/$file -done diff --git a/js/conf/Debug.js b/js/conf/Debug.js index aa4de47..27ae3d4 100644 --- a/js/conf/Debug.js +++ b/js/conf/Debug.js @@ -1,12 +1,12 @@ // Set prod to true when releasing -// _prod = true; -_prod = false; +_prod = true; +// _prod = false; Debug = { debug: true, keyboard: true, debugResizer: true, - debugArDetect: false, + debugArDetect: true, debugStorage: true, showArDetectCanvas: false, flushStoredSettings: false diff --git a/js/dep/chrome/chrome-extension-async.js b/js/dep/chrome/chrome-extension-async.js index 53b2bdd..66fe567 100644 --- a/js/dep/chrome/chrome-extension-async.js +++ b/js/dep/chrome/chrome-extension-async.js @@ -3,6 +3,13 @@ * @author Keith Henry * @license MIT */ (function () { + + // before we start: don't do shit in browsers that aren't Google Chrome. + // We might need to modify this for use in IE at a later date tho + if(chrome === undefined) + return; + + 'use strict'; /** Wrap a function with a callback with a Promise. diff --git a/js/modules/ArDetect.js b/js/modules/ArDetect.js index 4361741..e70571b 100644 --- a/js/modules/ArDetect.js +++ b/js/modules/ArDetect.js @@ -4,9 +4,6 @@ if(Debug.debug) var _ard_console_stop = "background: #000; color: #f41"; var _ard_console_start = "background: #000; color: #00c399"; - -// global-ish variables -var _ard_oldAr; var _ard_currentAr; @@ -100,10 +97,6 @@ var _arSetup = function(cwidth, cheight){ canvas.width = canvasWidth; canvas.height = canvasHeight; - // init oldAr to physical