Hello world
This commit is contained in:
commit
052a658932
|
@ -0,0 +1,37 @@
|
|||
// ==UserScript==
|
||||
// @name YouTube Mobile - Native controls
|
||||
// @namespace youtube-nativectl
|
||||
// @description Changes the video controls to your browser's native ones
|
||||
// @include http://m.youtube.com/*
|
||||
// @include https://m.youtube.com/*
|
||||
// @version 1.0
|
||||
// @grant none
|
||||
// @run-at document-start
|
||||
// ==/UserScript==
|
||||
|
||||
function addGlobalStyle(css) {
|
||||
var head, style;
|
||||
head = document.getElementsByTagName('head')[0];
|
||||
if (!head) { return; }
|
||||
style = document.createElement('style');
|
||||
style.type = 'text/css';
|
||||
style.innerHTML = css;
|
||||
head.appendChild(style);
|
||||
}
|
||||
|
||||
addControls = function()
|
||||
{
|
||||
elements = document.getElementsByClassName("html5-main-video")
|
||||
index = 0
|
||||
for (index = 0; index < elements.length; index++) {
|
||||
element = elements[index]
|
||||
if (element.getAttribute("controls") == null) {
|
||||
element.setAttribute("controls","")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
addGlobalStyle('#player-control-overlay { display: none !important }\n.ytp-autohide { cursor: auto !important }')
|
||||
setInterval(addControls,1000)
|
||||
})
|
|
@ -0,0 +1,18 @@
|
|||
// ==UserScript==
|
||||
// @name YouTube Mobile - No minimization halt
|
||||
// @namespace youtube-nomini
|
||||
// @description Do not halt videos when the page is minimized
|
||||
// @include http://m.youtube.com/*
|
||||
// @include https://m.youtube.com/*
|
||||
// @version 1.0
|
||||
// @grant none
|
||||
// @run-at document-start
|
||||
// ==/UserScript==
|
||||
|
||||
docEventListener = document.__proto__.addEventListener
|
||||
document.__proto__.addEventListener = function() {
|
||||
if (arguments[0] == "visibilitychange") {
|
||||
return
|
||||
}
|
||||
return docEventListener(...arguments)
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
// ==UserScript==
|
||||
// @name YouTube Mobile - No navigation on right click
|
||||
// @namespace youtube-norcnav
|
||||
// @description Do not navigate when right clicking
|
||||
// @include http://m.youtube.com/*
|
||||
// @include https://m.youtube.com/*
|
||||
// @version 1.0
|
||||
// @grant none
|
||||
// @run-at document-start
|
||||
// ==/UserScript==
|
||||
|
||||
wndEventListener = window.__proto__.addEventListener
|
||||
window.__proto__.addEventListener = function() {
|
||||
if (arguments[0] == "click") {
|
||||
return
|
||||
}
|
||||
return wndEventListener(...arguments)
|
||||
}
|
Loading…
Reference in New Issue