Reset video width with 'W'

This commit is contained in:
Brian Buller 2022-02-23 09:31:06 -06:00
parent 1aa2b7f9ab
commit 7e045e8759

View File

@ -1,7 +1,7 @@
// ==UserScript==
// @name Video Zen
// @namespace http://bullercodeworks.com
// @version 0.2
// @version 0.3
// @description Watch video in 'zen' mode
// @author brian@bullercodeworks.com
// @match http*://*/*
@ -77,7 +77,6 @@
}
function canZen() {
var v = document.getElementsByTagName('video')[0];
console.log(v);
return v != null;
}
function doPressEscape() {
@ -97,6 +96,12 @@
console.log("Zen mode cannot be activated.");
}
}
function doSetWidthTo100() {
if(zenExists()) {
var v = document.getElementsByTagName('video')[0];
v.style.width = '100%';
}
}
document.addEventListener('keyup',(e)=>{
console.log("Event Caught");
@ -104,6 +109,9 @@
case 'Escape':
doPressEscape();
break;
case 'KeyW':
doSetWidthTo100();
break;
}
});
})();