added vivaldi

This commit is contained in:
Stian Lund
2023-06-06 18:38:04 +02:00
parent cff5b1dc65
commit bb07058bcb
108 changed files with 9711 additions and 0 deletions
@@ -0,0 +1 @@
{"options":{"check_for_updates":false,"comment":"","compat_foreach":false,"compat_metadata":false,"compat_powerful_this":null,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":false,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":["*://*"],"orig_matches":[],"orig_noframes":null,"orig_run_at":"document-idle","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":["*://connect.garmin.com/*","*://*.ovps.de/*","*://*.vaberlin.de/*","*://*.discord.com/*"]},"run_at":null,"sandbox":null,"tab_types":null,"unwrap":null},"settings":{"enabled":true,"position":3},"meta":{"name":"Absolute Enable Right Click & Copy","uuid":"3ded8744-62b8-45b2-afdc-2daa3f6313af","modified":1672099402357,"file_url":"https://greasyfork.org/scripts/23772-absolute-enable-right-click-copy/code/Absolute%20Enable%20Right%20Click%20%20Copy.user.js"}}
@@ -0,0 +1 @@
{"ts":1654514671397,"data":{}}
@@ -0,0 +1,187 @@
// ==UserScript==
// @name Absolute Enable Right Click & Copy
// @namespace Absolute Right Click
// @description Force Enable Right Click & Copy & Highlight
// @shortcutKeys [Ctrl + `] Activate Absolute Right Click Mode To Force Remove Any Type Of Protection
// @author Absolute
// @version 1.8.9
// @include *://*
// @icon https://i.imgur.com/AC7SyUr.png
// @compatible Chrome Google Chrome + Tampermonkey
// @grant GM_registerMenuCommand
// @license BSD
// @copyright Absolute, 2016-Oct-06
// ==/UserScript==
(function() {
'use strict';
var css = document.createElement('style');
var head = document.head;
css.type = 'text/css';
css.innerText = `* {
-webkit-user-select: text !important;
-moz-user-select: text !important;
-ms-user-select: text !important;
user-select: text !important;
}`;
function main() {
var doc = document;
var body = document.body;
var docEvents = [
doc.oncontextmenu = null,
doc.onselectstart = null,
doc.ondragstart = null,
doc.onmousedown = null
];
var bodyEvents = [
body.oncontextmenu = null,
body.onselectstart = null,
body.ondragstart = null,
body.onmousedown = null,
body.oncut = null,
body.oncopy = null,
body.onpaste = null
];
[].forEach.call(
['copy', 'cut', 'paste', 'select', 'selectstart'],
function(event) {
document.addEventListener(event, function(e) { e.stopPropagation(); }, true);
}
);
alwaysAbsoluteMode();
enableCommandMenu();
head.appendChild(css);
document.addEventListener('keydown', keyPress);
}
function keyPress(event) {
if (event.ctrlKey && event.keyCode == 220) {
return confirm('Activate Absolute Right Click Mode!') == true ? absoluteMode() : null;
}
}
function absoluteMode() {
[].forEach.call(
['contextmenu', 'copy', 'cut', 'paste', 'mouseup', 'mousedown', 'keyup', 'keydown', 'drag', 'dragstart', 'select', 'selectstart'],
function(event) {
document.addEventListener(event, function(e) { e.stopPropagation(); }, true);
}
);
}
function alwaysAbsoluteMode() {
let sites = ['example.com','www.example.com'];
const list = RegExp(sites.join('|')).exec(location.hostname);
return list ? absoluteMode() : null;
}
function enableCommandMenu() {
var commandMenu = true;
try {
if (typeof(GM_registerMenuCommand) == undefined) {
return;
} else {
if (commandMenu == true ) {
GM_registerMenuCommand('Enable Absolute Right Click Mode', function() {
return confirm('Activate Absolute Right Click Mode!') == true ? absoluteMode() : null;
});
}
}
}
catch(err) {
console.log(err);
}
}
var blackList = [
'youtube.com','.google.','.google.com','greasyfork.org','twitter.com','instagram.com','facebook.com','translate.google.com','.amazon.','.ebay.','github.','stackoverflow.com',
'bing.com','live.com','.microsoft.com','dropbox.com','pcloud.com','box.com','sync.com','onedrive.com','mail.ru','deviantart.com','pastebin.com',
'dailymotion.com','twitch.tv','spotify.com','steam.com','steampowered.com','gitlab.com','.reddit.com'
]
var enabled = false;
var url = window.location.hostname;
var match = RegExp(blackList.join('|')).exec(url);
if (window && typeof window != undefined && head != undefined) {
if (!match && enabled != true) {
main();
enabled = true
//console.log(location.hostname);
window.addEventListener('contextmenu', function contextmenu(event) {
event.stopPropagation();
event.stopImmediatePropagation();
var handler = new eventHandler(event);
window.removeEventListener(event.type, contextmenu, true);
var eventsCallBack = new eventsCall(function() {});
handler.fire();
window.addEventListener(event.type, contextmenu, true);
if (handler.isCanceled && (eventsCallBack.isCalled)) {
event.preventDefault();
}
}, true);
}
function eventsCall() {
this.events = ['DOMAttrModified', 'DOMNodeInserted', 'DOMNodeRemoved', 'DOMCharacterDataModified', 'DOMSubtreeModified'];
this.bind();
}
eventsCall.prototype.bind = function() {
this.events.forEach(function (event) {
document.addEventListener(event, this, true);
}.bind(this));
};
eventsCall.prototype.handleEvent = function() {
this.isCalled = true;
};
eventsCall.prototype.unbind = function() {
this.events.forEach(function (event) {}.bind(this));
};
function eventHandler(event) {
this.event = event;
this.contextmenuEvent = this.createEvent(this.event.type);
}
eventHandler.prototype.createEvent = function(type) {
var target = this.event.target;
var event = target.ownerDocument.createEvent('MouseEvents');
event.initMouseEvent(
type, this.event.bubbles, this.event.cancelable,
target.ownerDocument.defaultView, this.event.detail,
this.event.screenX, this.event.screenY, this.event.clientX, this.event.clientY,
this.event.ctrlKey, this.event.altKey, this.event.shiftKey, this.event.metaKey,
this.event.button, this.event.relatedTarget
);
return event;
};
eventHandler.prototype.fire = function() {
var target = this.event.target;
var contextmenuHandler = function(event) {
event.preventDefault();
}.bind(this);
target.dispatchEvent(this.contextmenuEvent);
this.isCanceled = this.contextmenuEvent.defaultPrevented;
};
}
})();
@@ -0,0 +1 @@
{"options":{"check_for_updates":true,"comment":null,"compat_foreach":false,"compat_metadata":false,"compat_powerful_this":null,"compat_prototypes":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":false,"orig_connects":[],"orig_excludes":[],"orig_includes":[],"orig_matches":["*://*/*"],"orig_noframes":null,"orig_run_at":"document-start","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":["*://music.youtube.com/*"]},"run_at":null,"tab_types":null},"settings":{"enabled":true,"position":2},"meta":{"name":"Disable page close confirmation","uuid":"29b5aaa7-8ef4-41a9-b589-583bc41a5779","modified":1642196588804,"file_url":"https://greasyfork.org/scripts/4279-disable-page-close-confirmation/code/Disable%20page%20close%20confirmation.user.js"}}
@@ -0,0 +1 @@
{"ts":1642196591002,"data":{}}
+32
View File
@@ -0,0 +1,32 @@
// ==UserScript==
// @name Disable page close confirmation
// @description Disable page close confirmation (onBeforeUnload)
// @namespace http://nags.must.die
// @version 2.0
// @grant none
// @run-at document-start
// @match *://*/*
// ==/UserScript==
(function () {
var spoofer = {
enumerable: true,
configurable: false,
get: () => null,
set: fn => fn,
};
Object.defineProperties(window, {
onbeforeunload: spoofer,
onunload: spoofer,
});
var originalAdd = EventTarget.prototype.addEventListener;
EventTarget.prototype.addEventListener = function (type) {
var tl;
if (this !== window ||
typeof type !== 'string' ||
(tl = type.toLowerCase()) !== 'beforeunload' && tl !== 'unload') {
originalAdd.apply(this, arguments);
}
};
})();
@@ -0,0 +1 @@
{"options":{"check_for_updates":false,"comment":null,"compatopts_for_requires":true,"compat_wrappedjsobject":false,"compat_metadata":false,"compat_foreach":false,"compat_powerful_this":null,"sandbox":null,"noframes":null,"unwrap":null,"run_at":null,"tab_types":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":["https://www.google.com/url?*q=*"],"orig_matches":[],"orig_noframes":null,"orig_run_at":"document-start","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]}},"settings":{"enabled":true,"position":4},"meta":{"name":"Google I'm Feeling Lucky Redirect","uuid":"e8841671-f77e-4ce0-a44b-9d78f8618a39","modified":1672495936618,"file_url":"https://greasyfork.org/scripts/422086-google-i-m-feeling-lucky-redirect/code/Google%20I'm%20Feeling%20Lucky%20Redirect.user.js"}}
@@ -0,0 +1 @@
{"ts":1645628827820,"data":{}}
@@ -0,0 +1,21 @@
// ==UserScript==
// @name Google I'm Feeling Lucky Redirect
// @namespace https://snomiao.com/
// @version 0.3.0
// @description Immediately redirects when google prompts 'redirection notice'. Used to circumvent google pestering you when querying with I'm Feeling Lucky feature.
// @author snomiao
// @include https://www.google.com/url?*q=*
// @icon https://icons.duckduckgo.com/ip2/google.com.ico
// @run-at document-start
// @github https://github.com/snomiao/userscript.js/blob/master/GoogleImFeelingLuckyRedirect.user.js
// ==/UserScript==
// ref: [Workaround for Google I'm Feeling Lucky Redirect]( https://greasyfork.org/en/scripts/390770-workaround-for-google-i-m-feeling-lucky-redirect )
const url = Object.fromEntries(
location.search
.slice(1)
.split('&')
.map((e) => e.split('='))
).q;
if (url) location = url;
+1
View File
@@ -0,0 +1 @@
{"options":{"check_for_updates":true,"comment":null,"compatopts_for_requires":true,"compat_wrappedjsobject":false,"compat_metadata":false,"compat_foreach":false,"compat_powerful_this":null,"sandbox":null,"noframes":null,"unwrap":null,"run_at":null,"tab_types":null,"override":{"use_includes":[],"orig_includes":[],"merge_includes":true,"use_matches":[],"orig_matches":["*://*.rockpapershotgun.com/*"],"merge_matches":true,"use_excludes":[],"orig_excludes":["*://forum.rockpapershotgun.com/*"],"merge_excludes":true,"use_connects":[],"orig_connects":[],"merge_connects":true,"use_blockers":[],"orig_run_at":"document-start","orig_noframes":null}},"settings":{"enabled":true,"position":5},"meta":{"name":"RPS Night Mode","uuid":"0eb7141b-a77c-4f7d-b774-2599bfee0027","modified":1672497784464,"file_url":"https://greasyfork.org/scripts/370482-rps-night-mode/code/RPS%20Night%20Mode.user.js"}}
+1
View File
@@ -0,0 +1 @@
{"ts":1665846673062,"data":{}}
+37
View File
@@ -0,0 +1,37 @@
// ==UserScript==
// @name RPS Night Mode
// @namespace https://greasyfork.org/en/users/197428-pathduck
// @license MIT
// @version 0.40
// @description Night mode for site "Rock, Paper, Shotgun"
// @author Pathduck
// @supportURL https://greasyfork.org/en/scripts/370482-rps-night-mode
// @match *://*.rockpapershotgun.com/*
// @exclude *://forum.rockpapershotgun.com/*
// @icon https://icons.duckduckgo.com/ip2/rockpapershotgun.com.ico
// @grant GM_addStyle
// @run-at document-start
// ==/UserScript==
GM_addStyle(`
body {color: #eee !important; background: black !important;}
figcaption {color: #00b893 !important;}
input {color: #eee !important;}
#content {background: #393939 !important; border-radius: 16px;}
#comments .markdown {background: unset !important;}
.article[data-article-type], .summary[data-article-type] {--color: #ee77a7;--strap-color: #ee77a7;}
.article[data-premium=true], .summary[data-premium=true] {--color: #9763ff !important; --strap-color: #9763ff !important;}
.article_body_content blockquote {background: #222 !important;}
.app_header, .app_footer {background: black !important; border: none;}
.app_footer a, .app_footer button {color: #eee !important;}
.article p a, .article_header a {color: #00b893 !important;}
.archive_by_date a {color: #00b893 !important;}
.nav_primary a, .nav_secondary a {color: #eee !important;}
.profile-comments a {color: #00b893 !important;}
.section_title, .page_title, .label {color: #00b893 !important;}
.supporters_shelf .section_title {color: #9763ff !important;}
.strapline, .disclaimer, .alert {color: #eee !important;}
.title, .title a, .summary a {color: #00b893 !important;}
.thumbnail:after {content: unset !important;}
.username .name {color: white !important;}
`);
+1
View File
@@ -0,0 +1 @@
{"action_menu_columns":"1","action_menu_scripts_hide_disabled":false,"action_menu_scripts_sort":"auto","appearance_badge_color":"#ee3131","appearance_badges":"running","configMode":100,"connect_mode":"off","editor_autoLint":true,"editor_autoLintMaxLen":"1000000","editor_autoSave":true,"editor_easySave":true,"editor_electricChars":true,"editor_enabled":true,"editor_fontSize":"100","editor_highlightSelectionMatches":"cursor","editor_highlightTrailingWhitespace":true,"editor_indentUnit":"2","editor_indentWithTabs":"spaces","editor_keyMap":"windows","editor_lineWrapping":false,"editor_linter_config":null,"editor_tabMode":"classic","editor_tabSize":"2","editor_theme":"default","editor_trimTrailingSpacesFromModifiedLines":true,"enabled":true,"external_connect":"all","favicon_service":"duckduckgo","forbiddenPages":["*example.org/*","*paypal.tld/*","*stripe.com/*","/^.*:\\/\\/apis\\.google\\.com\\/((?!render)([^\\/]+)\\/)+([^\\/]+)?$/","*://www.facebook.com/plugins/*","*://platform.twitter.com/widgets/*"],"incognito_mode":"temporary","layout":"default","layout_user_css":"","notification_showUpdate":"changelog","page_filter_mode":"black","page_whitelist":["/https?:\\/\\/greasyfork\\.org\\/.*/"],"require_sri_mode":"supported","runtime_inject_mode":"default","script_blacklist_server":[{"rules":["/https?:\\/\\/userscripts\\.org\\/scripts\\/(source|version)/(102614).*\\.user\\.js/"],"severity":2},{"name":"SaveFrom.net helper","reason":"Shows advertisements","rules":["/https?:\\/\\/sf-addon\\.com\\/.*\\/.*\\.user\\.js/","/https?:\\/\\/.*\\.sf-helper\\.com\\/.*\\.user\\.js/"],"severity":3},{"reasons":{"en":"Used for a phishing compain to compromise users of baon-nutrition.com"},"rules":["/https?:\\/\\/files\\.ulysse\\.travel\\/.*\\.user\\.js/"],"severity":8},{"name":"Local YouTube Downloader","reasons":{"en":"Shows a disturbing alert message at every page with a youtube frame or iframe"},"rules":["/https?:\\/\\/greasyfork\\.org\\/scripts\\/369400-.*\\.user\\.js.*/"],"severity":8}],"webrequest_fixCSP":"no","webrequest_modHeaders":"no"}
+1
View File
@@ -0,0 +1 @@
{"options":{"check_for_updates":true,"comment":null,"compatopts_for_requires":true,"compat_wrappedjsobject":false,"compat_metadata":false,"compat_foreach":false,"compat_powerful_this":null,"sandbox":null,"noframes":null,"unwrap":null,"run_at":null,"tab_types":null,"override":{"use_includes":[],"orig_includes":[],"merge_includes":true,"use_matches":[],"orig_matches":["https://forum.vivaldi.net/*"],"merge_matches":true,"use_excludes":[],"orig_excludes":["https://forum.vivaldi.net/assets/*"],"merge_excludes":true,"use_connects":[],"orig_connects":[],"merge_connects":true,"use_blockers":[],"orig_run_at":"document-start","orig_noframes":null}},"settings":{"enabled":true,"position":6},"meta":{"name":"Vivaldi Forum Tweaks","uuid":"a59b229e-cfbc-4cfd-b626-57015e249641","modified":1672497628562,"file_url":"https://greasyfork.org/scripts/457399-vivaldi-forum-tweaks/code/Vivaldi%20Forum%20Tweaks.user.js"}}
+1
View File
@@ -0,0 +1 @@
{"ts":1672497325995,"data":{}}
+72
View File
@@ -0,0 +1,72 @@
// ==UserScript==
// @name Vivaldi Forum Tweaks
// @namespace https://greasyfork.org/en/users/197428-pathduck
// @license MIT
// @version 0.8
// @description CSS tweaks for Vivaldi Forums
// @author Pathduck
// @supportURL https://greasyfork.org/en/scripts/457399-vivaldi-forum-tweaks
// @match https://forum.vivaldi.net/*
// @exclude https://forum.vivaldi.net/assets/*
// @icon https://icons.duckduckgo.com/ip2/vivaldi.net.ico
// @grant GM_addStyle
// @run-at document-start
// ==/UserScript==
GM_addStyle(`
@media (min-width: 960px) {body {padding-top: 95px;}}
body {font-size: 15px;}
hr {margin: 5px;}
pre, pre code {padding: 5px !important;}
ul#vivaldimenu {margin-bottom: 0;};
small.pull-right {padding: 0; margin: 0px;}
#communitysubmenu { min-height: unset; top: 40px; padding: 0px;}
#content, main#panel {padding-top: 0px !important;}
#menucontent, #vivaldi-header, .navbar {min-height: unset; padding: 0; height: 40px;}
#menucontent>.row {padding: 5px 5px 0; height: 40px;}
#menucontent #search-form .form-control {margin: 5px;}
#menucontent #search-form input.form-control {max-width: unset !important; width: 320px;}
#newtopicbar {padding: 5px; margin-bottom: 5px;}
#submenu {top: 65px !important;}
#submenu.isfixed {top: 40px !important;}
#submenu, #submenu li, #submenu ul {line-height: 30px; height: 30px;}
#vivaldi-header .sublinks a {padding: 0;}
.account .cover {margin-top: 50px !important;}
.breadcrumb {padding: 0; margin-bottom: 0px;}
.btn {line-height: 1;}
.btn-toolbar {padding-top: 5px;}
.categories-title {margin: 5px 0 5px;}
.categories>li, .category>ul>li {margin-bottom: 0px; padding-bottom: 0px;}
.composer .preview, .composer .write {font-size: 15px;}
.dropdown-menu {font-size: 13px;}
.form-control:focus, .dropdown-toggle:focus {outline: solid !important;}
.header .notification-list, .header .chat-list {max-height: 60vh;}
.navbar-nav>li>a {padding: 10px 15px; margin-top: 2px;}
.navbar-nav>li>a#user_dropdown {padding: 5px 15px;margin-top: 2px;}
.posts-list-item.deleted {opacity: .5 !important;}
.search .bootstrap-tagsinput:has(input:focus) {outline: solid;}
.small.pull-right {margin-top: 0px;}
.topic-list-header {top: 30px;}
.topic h1 {line-height: 25px; font-weight: bold;}
.topic .topic-info, .topic .topic-info>* {margin-bottom: 0px; padding-bottom: 2px; padding-top: 0px;}
.topic .posts .content .img-responsive, .message-body img {max-width: 50vw; max-height: 30vh;}
/* Dark skin fixes */
.skin-dark blockquote {background-color: #333; border-left: 5px solid #4c70f0;}
.skin-dark code, .skin-dark pre {color: #fff; background-color: #333;}
.skin-dark .account .profile .profile-meta strong {color: #fff;}
.skin-dark .alert-window .alert {background-color: #333;}
.skin-dark .alert-window .alert.alert-info {color: limegreen;}
.skin-dark .alert-warning {background-color: darkred;}
.skin-dark .btn-primary, .pagination>.active>a {background-color: #3652b0;}
.skin-dark .composer .preview a {color: #809cff !important}
.skin-dark .label-success {background-color: green;}
.skin-dark .search .bootstrap-tagsinput,
.skin-dark .search .bootstrap-tagsinput input {border: 0; background-color: #272727; color: #fff;}
.skin-dark .topic .posts a {color: #809cff !important}
.skin-dark .topic .posts .dropdown-menu a {color: #fff !important}
/* External link warning */
a[rel^="nofollow"]::after{font-size:12px; content:"⚠️";}
a[href*="vivaldi"]::after{content: unset;}
`);
@@ -0,0 +1 @@
{"options":{"check_for_updates":true,"comment":null,"compat_foreach":false,"compat_metadata":false,"compat_powerful_this":null,"compat_prototypes":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":[],"orig_matches":["https://www.youtube.com/*"],"orig_noframes":true,"orig_run_at":"document-idle","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null},"settings":{"enabled":true,"position":1},"meta":{"name":"YouTube fast fullscreen toggle","uuid":"7cbfb171-b070-4682-a3e4-07918a9e9632","modified":1632432693263,"file_url":"https://raw.githubusercontent.com/ZimbiX/youtube-fast-fullscreen-toggle/master/extension/contentScript.js"}}
@@ -0,0 +1 @@
{"ts":1616100197540,"data":{}}
+132
View File
@@ -0,0 +1,132 @@
// ==UserScript==
// @name YouTube fast fullscreen toggle
// @namespace http://tampermonkey.net/
// @version 2.7.0
// @description Avoids the ~3 second lag when entering/exiting fullscreen on a YouTube video - by hiding the heavy fluff while transitioning
// @author Brendan Weibrecht
// @match https://www.youtube.com/*
// @noframes
// @icon https://raw.githubusercontent.com/ZimbiX/youtube-fast-fullscreen-toggle/master/extension/icon-128.png
// @downloadURL https://raw.githubusercontent.com/ZimbiX/youtube-fast-fullscreen-toggle/master/extension/contentScript.js
// @grant none
// ==/UserScript==
(function() {
'use strict';
const isWatchVideoPage = () => window.location.pathname == "/watch"
const fluff = ['#secondary-inner', '#info', '#meta', '#comments', '#masthead-container', '#speedyg']
const setFluffDisplay = (value) => {
fluff.forEach(selector => {
document.querySelectorAll(selector).forEach(el => {
el.style.display = value
})
})
}
const hideFluff = () => {
console.log(`[YT-FFT] Hiding fluff`)
setFluffDisplay('none')
}
const showFluff = () => {
console.log(`[YT-FFT] Showing fluff again`)
setFluffDisplay('')
}
const isInFullscreen = () => !!document.fullscreenElement
// Opposite since we will be checking this only after it's changed by YouTube
const checkIfDirectionIsLeavingFullscreen = () => !isInFullscreen()
const playerWidthDiff = (player) => Math.abs(player.clientWidth - window.innerWidth)
const playerHeightDiff = (player) => Math.abs(player.clientHeight - window.innerHeight)
const playerIsFullWidth = (player) => playerWidthDiff(player) <= 2
const playerIsFullHeight = (player) => playerHeightDiff(player) <= 2
const debugPlayerSize = (player) => {
console.log('[YT-FFT] w:', player.clientHeight, window.innerHeight, 'h:', player.clientWidth, window.innerWidth)
}
const playerIsFullscreen = () => {
const player = document.querySelector('ytd-player')
debugPlayerSize(player)
return playerIsFullHeight(player) && playerIsFullWidth(player)
}
const isFinishedLeavingFullscreen = () => !playerIsFullscreen()
const isFinishedEnteringFullscreen = () => playerIsFullscreen()
const transitionIsFinished = (directionIsLeavingFullscreen) => (
directionIsLeavingFullscreen ? isFinishedLeavingFullscreen() : isFinishedEnteringFullscreen()
)
const timedOut = (startedAt) => new Date() - startedAt >= 2000
const showFluffWhenReady = (directionIsLeavingFullscreen, startedAt) => {
if (timedOut(startedAt)) {
console.log(`[YT-FFT] Timed out detecting finish of ${directionIsLeavingFullscreen ? 'leaving' : 'entering'} fullscreen transition`)
showFluff()
} else if (transitionIsFinished(directionIsLeavingFullscreen)) {
console.log(`[YT-FFT] Finished ${directionIsLeavingFullscreen ? 'leaving' : 'entering'} fullscreen transition`)
// Delay a little after entering fullscreen for reliability, since delay before showing the fluff when entering fullscreen is not noticeable
directionIsLeavingFullscreen ? showFluff() : setTimeout(showFluff, 20)
} else {
setTimeout(() => showFluffWhenReady(directionIsLeavingFullscreen, startedAt), 10)
}
}
const fastToggleFullScreen = () => {
hideFluff()
// Wait until YouTube's event handler has executed. This is required since the order of event handler execution is not guaranteed, and we need to be able to reliably detect the transition direction
setTimeout(() => {
const directionIsLeavingFullscreen = checkIfDirectionIsLeavingFullscreen()
console.log(`[YT-FFT] Waiting until ${directionIsLeavingFullscreen ? 'leaving' : 'entering'} fullscreen transition has finished`)
showFluffWhenReady(directionIsLeavingFullscreen, new Date())
}, 10)
}
const isWritingText = (e) => (
e.path[0].tagName == 'INPUT' ||
e.path[0].id == 'contenteditable-root'
)
const delegateEvent = (eventName, elementSelector, handler) => {
document.addEventListener(eventName, (e) => {
// loop parent nodes from the target to the delegation node
for (var target = e.target; target && target != this; target = target.parentNode) {
if (target.matches && target.matches(elementSelector)) {
handler(target, e)
break
}
}
}, false)
}
const addEventListeners = () => {
delegateEvent('click', '.ytp-fullscreen-button', e => {
if (isWatchVideoPage()) {
fastToggleFullScreen()
}
})
delegateEvent('dblclick', 'video', e => {
if (isWatchVideoPage()) {
fastToggleFullScreen()
}
})
document.addEventListener("keydown", e => {
if (isWatchVideoPage() && e.code == 'KeyF' && !isWritingText(e)) {
console.log(e)
fastToggleFullScreen()
}
})
}
addEventListeners()
console.log(`[YT-FFT] Initialised`)
})();
+58
View File
@@ -0,0 +1,58 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Author" content="Made by 'tree'">
<meta name="GENERATOR" content="$Version: $ tree v1.7.0 (c) 1996 - 2014 by Steve Baker, Thomas Moore, Francesc Rocher, Florian Sesser, Kyosuke Tokoro $">
<title>userscript</title>
<style type="text/css">
<!--
BODY { font-family : ariel, monospace, sans-serif; }
P { font-weight: normal; font-family : ariel, monospace, sans-serif; color: black; background-color: transparent;}
B { font-weight: normal; color: black; background-color: transparent;}
A:visited { font-weight : normal; text-decoration : none; background-color : transparent; margin : 0px 0px 0px 0px; padding : 0px 0px 0px 0px; display: inline; }
A:link { font-weight : normal; text-decoration : none; margin : 0px 0px 0px 0px; padding : 0px 0px 0px 0px; display: inline; }
A:hover { color : #000000; font-weight : normal; text-decoration : underline; background-color : yellow; margin : 0px 0px 0px 0px; padding : 0px 0px 0px 0px; display: inline; }
A:active { color : #000000; font-weight: normal; background-color : transparent; margin : 0px 0px 0px 0px; padding : 0px 0px 0px 0px; display: inline; }
.VERSION { font-size: small; font-family : arial, sans-serif; }
.NORM { color: black; background-color: transparent;}
.FIFO { color: purple; background-color: transparent;}
.CHAR { color: yellow; background-color: transparent;}
.DIR { color: blue; background-color: transparent;}
.BLOCK { color: yellow; background-color: transparent;}
.LINK { color: aqua; background-color: transparent;}
.SOCK { color: fuchsia;background-color: transparent;}
.EXEC { color: green; background-color: transparent;}
-->
</style>
</head>
<body>
<h1>userscript</h1><p>
<a class="NORM" href="..">..</a><br>
[&nbsp;981&nbsp;Dec&nbsp;31&nbsp;14:51]&nbsp;&nbsp;<a class="EXEC" href="./Absolute Enable Right Click & Copy.options.json">Absolute Enable Right Click & Copy.options.json</a><br>
[&nbsp;&nbsp;30&nbsp;Dec&nbsp;31&nbsp;14:51]&nbsp;&nbsp;<a class="EXEC" href="./Absolute Enable Right Click & Copy.storage.json">Absolute Enable Right Click & Copy.storage.json</a><br>
[6.3K&nbsp;Dec&nbsp;27&nbsp;&nbsp;0:03]&nbsp;&nbsp;<a class="EXEC" href="./Absolute Enable Right Click & Copy.user.js">Absolute Enable Right Click & Copy.user.js</a><br>
[&nbsp;908&nbsp;Dec&nbsp;31&nbsp;14:51]&nbsp;&nbsp;<a class="EXEC" href="./Disable page close confirmation.options.json">Disable page close confirmation.options.json</a><br>
[&nbsp;&nbsp;30&nbsp;Dec&nbsp;31&nbsp;14:51]&nbsp;&nbsp;<a class="EXEC" href="./Disable page close confirmation.storage.json">Disable page close confirmation.storage.json</a><br>
[&nbsp;834&nbsp;Jan&nbsp;14&nbsp;&nbsp;2022]&nbsp;&nbsp;<a class="EXEC" href="./Disable page close confirmation.user.js">Disable page close confirmation.user.js</a><br>
[&nbsp;920&nbsp;Dec&nbsp;31&nbsp;14:51]&nbsp;&nbsp;<a class="EXEC" href="./Google I'm Feeling Lucky Redirect.options.json">Google I'm Feeling Lucky Redirect.options.json</a><br>
[&nbsp;&nbsp;30&nbsp;Dec&nbsp;31&nbsp;14:51]&nbsp;&nbsp;<a class="EXEC" href="./Google I'm Feeling Lucky Redirect.storage.json">Google I'm Feeling Lucky Redirect.storage.json</a><br>
[&nbsp;899&nbsp;Dec&nbsp;31&nbsp;14:12]&nbsp;&nbsp;<a class="EXEC" href="./Google I'm Feeling Lucky Redirect.user.js">Google I'm Feeling Lucky Redirect.user.js</a><br>
[&nbsp;889&nbsp;Dec&nbsp;31&nbsp;14:51]&nbsp;&nbsp;<a class="EXEC" href="./RPS Night Mode.options.json">RPS Night Mode.options.json</a><br>
[&nbsp;&nbsp;30&nbsp;Dec&nbsp;31&nbsp;14:51]&nbsp;&nbsp;<a class="EXEC" href="./RPS Night Mode.storage.json">RPS Night Mode.storage.json</a><br>
[1.8K&nbsp;Dec&nbsp;31&nbsp;14:43]&nbsp;&nbsp;<a class="EXEC" href="./RPS Night Mode.user.js">RPS Night Mode.user.js</a><br>
[2.0K&nbsp;Dec&nbsp;31&nbsp;14:51]&nbsp;&nbsp;<a class="EXEC" href="./Tampermonkey.global.json">Tampermonkey.global.json</a><br>
[&nbsp;908&nbsp;Dec&nbsp;31&nbsp;14:51]&nbsp;&nbsp;<a class="EXEC" href="./Vivaldi Forum Tweaks.options.json">Vivaldi Forum Tweaks.options.json</a><br>
[&nbsp;&nbsp;30&nbsp;Dec&nbsp;31&nbsp;14:51]&nbsp;&nbsp;<a class="EXEC" href="./Vivaldi Forum Tweaks.storage.json">Vivaldi Forum Tweaks.storage.json</a><br>
[3.4K&nbsp;Dec&nbsp;31&nbsp;14:40]&nbsp;&nbsp;<a class="EXEC" href="./Vivaldi Forum Tweaks.user.js">Vivaldi Forum Tweaks.user.js</a><br>
[&nbsp;885&nbsp;Dec&nbsp;31&nbsp;14:51]&nbsp;&nbsp;<a class="EXEC" href="./YouTube fast fullscreen toggle.options.json">YouTube fast fullscreen toggle.options.json</a><br>
[&nbsp;&nbsp;30&nbsp;Dec&nbsp;31&nbsp;14:51]&nbsp;&nbsp;<a class="EXEC" href="./YouTube fast fullscreen toggle.storage.json">YouTube fast fullscreen toggle.storage.json</a><br>
[5.2K&nbsp;Sep&nbsp;23&nbsp;&nbsp;2021]&nbsp;&nbsp;<a class="EXEC" href="./YouTube fast fullscreen toggle.user.js">YouTube fast fullscreen toggle.user.js</a><br>
<br><br>
</p>
<p>
0 directories, 19 files
<br><br>
</p>
</html>