To force Low Resource
目前為
// ==UserScript==
// @name YouTube: Plain Video Player
// @namespace UserScripts
// @match https://www.youtube.com/watch?*
// @exclude /^https?://\S+\.(txt|png|jpg|jpeg|gif|xml|svg|manifest|log|ini)[^\/]*$/
// @grant none
// @version 0.1.0
// @author CY Fung
// @license MIT
// @description To force Low Resource
// @run-at document-start
// @inject-into page
// @unwrap
// @license MIT
// @compatible chrome
// @compatible firefox
// @compatible opera
// @compatible edge
// @compatible safari
// @allFrames true
// ==/UserScript==
(() => {
const pp = {
create() {
},
setProperties() {
}
}
let mm = new Proxy({}, {
get(target, prop) {
// throw SyntaxError();
// return pp;
return true
},
set(target, prop, val) {
return true;
},
configurable: true,
enumerable: false
});
addCSS = 0;
Object.defineProperty(Object.prototype, '__mixinSet', {
get() {
if (!addCSS) {
addCSS = 1;
document.head.appendChild(document.createElement('style')).textContent = `
.container, #container, #masthead {
visibility: collapse;
display: none !important;
}
.container *, #container *, #masthead *{
margin:0 !important;
padding:0 !important;
border:0 !important;
}
:fullscreen #movie_player{
position:fixed;
top:0;
left:0;
right:0;
bottom:0;
}
#player.skeleton.flexy #player-wrap[id] {
width:initial;
}
#ytp-next-button, .ytp-next-button {
display: none !important;
}
`;
}
let rr = window.onerror;
window.onerror = function () { return true; }
Promise.resolve().then(() => {
window.onerror = rr
})
throw new Error('');
return mm;
},
set(nv) {
return true;
},
configurable: true,
enumerable: false
})
})();