Extra videos, BrowserDetect is getting set up for Edge

This commit is contained in:
Tamius Han 2018-01-17 20:57:24 +01:00
parent f443fb62ec
commit ee626fd5dd
6 changed files with 101 additions and 6 deletions

View File

@ -1,12 +1,30 @@
var _bd_usebrowser = "firefox";
if(typeof browser === "undefined"){ // This means we're probably not on Firefox.
var _bd_isFirefox = false;
var _bd_isChrome = false;
var _bd_isEdge = true; // we'll see if FF
try{
// this will fail in Edge
var promise = browser.runtime.getBrowserInfo();
_bd_isFirefox = true;
_bd_isEdge = false;
}
catch (e) {};
if(typeof browser === "undefined"){ // This is a good sign we're in chrome or chromium-based browsers
if(chrome){
browser = chrome;
_bd_usebrowser = "chrome";
_bd_usebrowser = "chrome;
_bd_isChrome = true;
_bd_isEdge = false;
}
}
var BrowserDetect = {
usebrowser: _bd_usebrowser
usebrowser: _bd_usebrowser,
firefox: _bd_isFirefox,
chrome: _bd_isChrome,
edge: _bd_isEdge
}

View File

@ -11,7 +11,7 @@ var _com_chrome_tabquery_wrapper = async function(tabInfo){
var _com_queryTabs = async function(tabInfo){
if(BrowserDetect.usebrowser == "chrome"){
if(BrowserDetect.usebrowser != "firefox"){
return await _com_chrome_tabquery_wrapper(tabInfo);
}
else{
@ -39,7 +39,7 @@ var _com_chrome_tabs_sendmsg_wrapper = async function(tab, message, options){
}
var _com_sendMessage = async function(tab, message, options){
if(BrowserDetect.usebrowser == "chrome"){
if(BrowserDetect.usebrowser != "firefox"){
var r = await _com_chrome_tabs_sendmsg_wrapper(tab, message, options);
console.log("TESTING what is this owo? (should be a promise)", r);
return r;
@ -67,7 +67,7 @@ var _com_chrome_tabs_sendmsgrt_wrapper = async function(message){
}
var _com_sendMessageRuntime = async function(message){
if(BrowserDetect.usebrowser == "chrome"){
if(BrowserDetect.usebrowser != "firefox"){
return _com_chrome_tabs_sendmsgrt_wrapper(message);
}
else{

73
manifest-chrome.json Normal file
View File

@ -0,0 +1,73 @@
{
"manifest_version": 2,
"name": "Ultrawidify",
"version": "2.0.2",
"icons": {
"32":"res/icons/uw-32.png",
"64":"res/icons/uw-64.png"
},
"description": "Aspect ratio fixer for youtube that works around some people's disability to properly encode 21:9 (and sometimes, 16:9) videos.",
"content_scripts": [{
"matches": ["*://*/*"],
"js": [
"js/dep/jquery-3.1.1.js",
"js/dep/chrome/chrome-extension-async.js",
"js/lib/BrowserDetect.js",
"js/lib/StorageManager.js",
"js/lib/Comms.js",
"js/conf/Debug.js",
"js/conf/Settings.js",
"js/conf/SitesConf.js",
"js/conf/Status.js",
"js/conf/ExtensionConf.js",
"js/lib/FullScreenDetect.js",
"js/modules/PageInfo.js",
"js/modules/ArDetect.js",
"js/modules/Resizer.js",
"js/conf/Keybinds.js",
"js/uw.js" ],
"all_frames": true
}],
"permissions": [
"tabs", "storage", "activeTab", "<all_urls>", "*://*.youtube.com/*", "*://youtube.com/*", "*://imdb.com/*", "*://*.imdb.com/*"
],
"browser_action": {
"default_icon": "res/icons/uw-32.png",
"default_popup": "res/popup/popup.html",
"default_title": "Ultrawidify"
},
"web_accessible_resources": [
"js/*",
"res/img/ytplayer-icons/zoom.png",
"res/img/ytplayer-icons/unzoom.png",
"res/img/ytplayer-icons/fitw.png",
"res/img/ytplayer-icons/fith.png",
"res/img/ytplayer-icons/reset.png",
"res/img/ytplayer-icons/settings.png",
"res/img/settings/about-bg.png",
"res/css/uw_common.css",
"res/css/uw_yt.css",
"res/css/uw_netflix.css",
"res/css/uw_settings.css"
],
"options_ui" : {
"page": "res/settings/settings.html",
"open_in_tab": true
}
}

BIN
res/icons/uw-128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -17,3 +17,7 @@ https://www.youtube.com/watch?v=L_u97PqWX6g (also dark at the start)
### Dark or triggering minor AR corrections
https://www.youtube.com/watch?v=NaTGwlfRB_c (dark, triggers minor corrections)
### Watermark stopping AR
https://www.youtube.com/watch?v=tXTFdDrd7pA