From 872bc4ece7ba79fae7428d00aa000315a3f03c1b Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Thu, 19 Jul 2018 23:05:39 +0200 Subject: [PATCH] Some work on settings --- js/conf/ExtensionConf.js | 4 +- res/css/uw_common.css | 57 ------ res/css/uw_netflix.css | 39 ---- res/css/uw_settings.css | 1 - res/css/uw_yt.css | 28 --- res/popup/popup.html | 113 +---------- res/settings/settings.html | 375 ++++++++++++++----------------------- 7 files changed, 154 insertions(+), 463 deletions(-) delete mode 100644 res/css/uw_common.css delete mode 100644 res/css/uw_netflix.css delete mode 100644 res/css/uw_settings.css delete mode 100644 res/css/uw_yt.css diff --git a/js/conf/ExtensionConf.js b/js/conf/ExtensionConf.js index e9fd5cb..d3db062 100644 --- a/js/conf/ExtensionConf.js +++ b/js/conf/ExtensionConf.js @@ -194,13 +194,13 @@ var ExtensionConf = { status: "enabled", // should extension work on this site? arStatus: "default", // should we enable autodetection statusEmbedded: "enabled", // should extension work for this site when embedded on other sites? - override: true // ignore value localStorage in favour of this + override: false // ignore value localStorage in favour of this }, "www.netflix.com" : { status: "enabled", arStatus: BrowserDetect.firefox ? "default" : "disabled", statusEmbedded: "enabled", - override: true + override: false }, } } diff --git a/res/css/uw_common.css b/res/css/uw_common.css deleted file mode 100644 index e5c980d..0000000 --- a/res/css/uw_common.css +++ /dev/null @@ -1,57 +0,0 @@ -@import url('https://fonts.googleapis.com/css?family=Oxygen:300,400&subset=latin-ext'); - -.show{ - display: block !important; -} -.uw_hide{ - display: none !important; -} - -.uw_submenu{ - display: none; - position: absolute; - background-color: rgba(0,0,0,0.66); -} -/* -.uw-setmenu{ - padding-left: 2em !important; - padding-right: 2em !important; -}*/ - -.uw_submenu_bottom0{ - bottom: 0px; -} - -.display_relative{ - display: relative; -} - -.uw-setmenu-item{ - padding-right: 2em !important; - padding-left: 2em !important; -} - -.common_anchor { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - overflow: hidden; -} - -.uw_button{ - display: inline-block; -/* height: 100% !important; */ - background-size: 75% 75%; - background-repeat: no-repeat; - background-position: center center; -} - -.uw_ui_anchor{ - display: inline-block; -} -#uw_ui_anchor{ - display: inline-block; - -} diff --git a/res/css/uw_netflix.css b/res/css/uw_netflix.css deleted file mode 100644 index 41896a1..0000000 --- a/res/css/uw_netflix.css +++ /dev/null @@ -1,39 +0,0 @@ -.uw-button{ - display: inline-block; -/* height: 100% !important; */ - background-size: 75% 75%; - background-repeat: no-repeat; - background-position: center center; -} - -.uw-button-row { - display: inline-block !important; - position: absolute !important; - top: 0 !important; - right: 0 !important; - width: 99% !important; - height: 100% !important; - z-index: 1337 !important; - text-align: right; -} - -.uw-button:hover{ - background-color: rgba(192,0,0,0.66); -} -.uw-setmenu{ - display: none; - position: absolute; - background-color: rgba(0,0,0,0.66); - right: 0px; -} -.uw-setmenu-item{ - display: flex; - align-items: center; - font-family: "Oxygen"; - color: #ffffff !important; - width: 90%; - padding-left: 10%; -} -.uw-setmenu-item:hover{ - background-color: rgba(192,0,0,0.66); -} diff --git a/res/css/uw_settings.css b/res/css/uw_settings.css deleted file mode 100644 index 8bbf7e2..0000000 --- a/res/css/uw_settings.css +++ /dev/null @@ -1 +0,0 @@ -/* yeah this is also a placeholder file, this time for 'settings' page */ diff --git a/res/css/uw_yt.css b/res/css/uw_yt.css deleted file mode 100644 index d933f82..0000000 --- a/res/css/uw_yt.css +++ /dev/null @@ -1,28 +0,0 @@ -.uw-button{ - display: inline-block; - height: 100% !important; - background-size: 75% 75%; - background-repeat: no-repeat; - background-position: center center; -} -.uw-button:hover{ - background-color: rgba(192,0,0,0.66); -} -.uw-setmenu{ - display: none; - position: absolute; - background-color: rgba(0,0,0,0.66); - right: 0px; -} -.uw-setmenu-item{ - display: flex; - align-items: center; - font-family: "Oxygen"; - color: #ffffff !important; -} -.uw-setmenu-item:hover{ - background-color: rgba(192,0,0,0.66); -} -.uw_top{ - z-index: 1337; -} diff --git a/res/popup/popup.html b/res/popup/popup.html index 2918b84..f037eb2 100644 --- a/res/popup/popup.html +++ b/res/popup/popup.html @@ -5,6 +5,7 @@ + @@ -214,24 +132,7 @@
If you see this line, then your browser didn't start the popup script yet. This is a problem caused by the browser. Please wait a few seconds.
- - - +
- - -
Shortcuts
+
General settings
+
Site options
+
Shortcuts
About
+ + + - -
+
-
-
Enable automatic aspect ratio detection
-
This option uses 3rd party websites to determine aspect ratio. It may not work all the time or even properly. It only works with Netflix. This option is NOT available on Youtube. Also deprecated probably, tamius pls remove
-
-
-
Enable brute-force automatic aspect ratio detection
-
Pretend that this checkbox is checked and that you can't uncheck it.

This option works by checking where black pixels end on _every_ frame (technically every ~30ms). Because of this, this option may cause lagginess and increased CPU usage. also you can't not use it because we're doing a total rewrite lol
-
-
-
Yes, the UI is gone. [..] but why is the UI gone?
+ +
+ Enable this extension: + + + Always enables this extension on every site you visit that you didn't blacklist. + On whitelisted sites enables this extension only on sites you explicitly whitelisted. + Never disables extension on all sites, even on those you whitelisted. + +
+ +
+ Enable autodetection: + + + Always enables autodetection on every site this extension is enabled for, unless blacklisted. + On whitelisted sites enables autodetection only for sites that you explicitly enabled. + Never disables autodetection on all sites, even on those you whitelisted. + +
+ +
+ In-player UI + +
- - - - - - + +
+ Video alignment: +
+ left + center + right +
+
+ +
+ +
+ + + + +
+ +
+ Enable autodetection: + +
+ Always enables autodetection on every site this extension is enabled for, unless blacklisted. + On whitelisted sites enables autodetection only for sites that you explicitly enabled. + Never disables autodetection on all sites, even on those you whitelisted. +
+
+ +
+ Checking for aspect ratio changes +
+ When video is playing: ms +
+
+ When video is paused: ms +
+
+ On error: ms +
+ +
+ All values are in milliseconds. + The values determine how often the autodetection script will scan video for changes in aspect ratio under different circumstances. + Using shorter intervals can cause lag and increases resource usage. + Using longer intervals increases delay between aspect ratio changing and said change being detected. +
+
+ +
+ + todo: insert checkbox +
+

In order for autodetection to work, the extension grabs a frame of the video you're watching and takes a look at it. + Some websites use DRM, which prevents you from using the HTML5-blessed way of getting a frame from a video. + Some browsers offer some features that can be used to circumvent DRM protection. + With this option enabled, the extension will use said features to basically do that. +

+

Technical details: tl;dr — only works in Firefox and maybe its forks.
+ Fallback mode depends on two things: +

    +
  1. Attempting to grab a video frame from DRM protected video stream must return an error (Chrome returns black image)
  2. +
  3. Supports CanvasRenderingContext2D.drawWindow() method, which pretty much only Firefox does
  4. +
+

+

But I thought it's illegal to circumvent DRM?
+ Courts disagree (at least as far as our use-case is concerned). + At this point I'd also throw in some choice words about DRM and everyone using it, but AMO gives me "you're breaking terms of conduct" warnings over use of the word for thing you flush down the toilet, prepended by a word for male cow*, in the code comments.
*'cow' is term for the female
+

+
+
+ +
+ + + + +
+ +
+ + + +

PLEASE NOTE: THIS IS COMPLETELY NON-FUNCTIONAL ATM. YOU CANT SET SITE-SPECIFIC OPTIONS ATM

@@ -265,7 +175,10 @@
-
+ + + +

Keyboard shortcuts

@@ -343,6 +256,9 @@
+ + +

Ultrawidify - an aspect ratio fixer for youtube (and netflix)

@@ -366,7 +282,6 @@
-