From 3d6917402e6ee4ff1058f22da0145f3f4c0f8c41 Mon Sep 17 00:00:00 2001 From: Stian Lund <1493836+Pathduck@users.noreply.github.com> Date: Sat, 31 Dec 2022 16:52:33 +0100 Subject: [PATCH] add Userscript --- test/index.html | 3 +- test/media-fullscreen/index.html | 17 ++ ...ute Enable Right Click & Copy.options.json | 1 + ...ute Enable Right Click & Copy.storage.json | 1 + ...Absolute Enable Right Click & Copy.user.js | 187 ++++++++++++++++++ ...sable page close confirmation.options.json | 1 + ...sable page close confirmation.storage.json | 1 + .../Disable page close confirmation.user.js | 32 +++ ...le I'm Feeling Lucky Redirect.options.json | 1 + ...le I'm Feeling Lucky Redirect.storage.json | 1 + .../Google I'm Feeling Lucky Redirect.user.js | 21 ++ .../Userscript/RPS Night Mode.options.json | 1 + .../Userscript/RPS Night Mode.storage.json | 1 + vivaldi/Userscript/RPS Night Mode.user.js | 37 ++++ vivaldi/Userscript/Tampermonkey.global.json | 1 + .../Vivaldi Forum Tweaks.options.json | 1 + .../Vivaldi Forum Tweaks.storage.json | 1 + .../Userscript/Vivaldi Forum Tweaks.user.js | 72 +++++++ ...ouTube fast fullscreen toggle.options.json | 1 + ...ouTube fast fullscreen toggle.storage.json | 1 + .../YouTube fast fullscreen toggle.user.js | 132 +++++++++++++ vivaldi/Userscript/index.html | 58 ++++++ vivaldi/index.html | 3 +- 23 files changed, 573 insertions(+), 2 deletions(-) create mode 100755 test/media-fullscreen/index.html create mode 100755 vivaldi/Userscript/Absolute Enable Right Click & Copy.options.json create mode 100755 vivaldi/Userscript/Absolute Enable Right Click & Copy.storage.json create mode 100755 vivaldi/Userscript/Absolute Enable Right Click & Copy.user.js create mode 100755 vivaldi/Userscript/Disable page close confirmation.options.json create mode 100755 vivaldi/Userscript/Disable page close confirmation.storage.json create mode 100755 vivaldi/Userscript/Disable page close confirmation.user.js create mode 100755 vivaldi/Userscript/Google I'm Feeling Lucky Redirect.options.json create mode 100755 vivaldi/Userscript/Google I'm Feeling Lucky Redirect.storage.json create mode 100755 vivaldi/Userscript/Google I'm Feeling Lucky Redirect.user.js create mode 100755 vivaldi/Userscript/RPS Night Mode.options.json create mode 100755 vivaldi/Userscript/RPS Night Mode.storage.json create mode 100755 vivaldi/Userscript/RPS Night Mode.user.js create mode 100755 vivaldi/Userscript/Tampermonkey.global.json create mode 100755 vivaldi/Userscript/Vivaldi Forum Tweaks.options.json create mode 100755 vivaldi/Userscript/Vivaldi Forum Tweaks.storage.json create mode 100755 vivaldi/Userscript/Vivaldi Forum Tweaks.user.js create mode 100755 vivaldi/Userscript/YouTube fast fullscreen toggle.options.json create mode 100755 vivaldi/Userscript/YouTube fast fullscreen toggle.storage.json create mode 100755 vivaldi/Userscript/YouTube fast fullscreen toggle.user.js create mode 100644 vivaldi/Userscript/index.html diff --git a/test/index.html b/test/index.html index d07d399..7a255ce 100644 --- a/test/index.html +++ b/test/index.html @@ -34,6 +34,7 @@ [   0 Jul  9 12:51]  focus
[   0 Nov  9 17:43]  js
[   0 Jul  9 12:45]  login
+[   0 Dec 30 12:43]  media-fullscreen
[   0 Jul  9 12:45]  pdf
[   0 Jul  9 12:45]  referrer
[   0 Oct  7 18:29]  test-links
@@ -45,7 +46,7 @@

-10 directories, 2 files +11 directories, 2 files

diff --git a/test/media-fullscreen/index.html b/test/media-fullscreen/index.html new file mode 100755 index 0000000..742a9f7 --- /dev/null +++ b/test/media-fullscreen/index.html @@ -0,0 +1,17 @@ + + + + + +
+
+ + + diff --git a/vivaldi/Userscript/Absolute Enable Right Click & Copy.options.json b/vivaldi/Userscript/Absolute Enable Right Click & Copy.options.json new file mode 100755 index 0000000..3730074 --- /dev/null +++ b/vivaldi/Userscript/Absolute Enable Right Click & Copy.options.json @@ -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"}} \ No newline at end of file diff --git a/vivaldi/Userscript/Absolute Enable Right Click & Copy.storage.json b/vivaldi/Userscript/Absolute Enable Right Click & Copy.storage.json new file mode 100755 index 0000000..8e96181 --- /dev/null +++ b/vivaldi/Userscript/Absolute Enable Right Click & Copy.storage.json @@ -0,0 +1 @@ +{"ts":1654514671397,"data":{}} \ No newline at end of file diff --git a/vivaldi/Userscript/Absolute Enable Right Click & Copy.user.js b/vivaldi/Userscript/Absolute Enable Right Click & Copy.user.js new file mode 100755 index 0000000..5fb68f2 --- /dev/null +++ b/vivaldi/Userscript/Absolute Enable Right Click & Copy.user.js @@ -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; + }; + + } + +})(); + diff --git a/vivaldi/Userscript/Disable page close confirmation.options.json b/vivaldi/Userscript/Disable page close confirmation.options.json new file mode 100755 index 0000000..a46256a --- /dev/null +++ b/vivaldi/Userscript/Disable page close confirmation.options.json @@ -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"}} \ No newline at end of file diff --git a/vivaldi/Userscript/Disable page close confirmation.storage.json b/vivaldi/Userscript/Disable page close confirmation.storage.json new file mode 100755 index 0000000..d5f701e --- /dev/null +++ b/vivaldi/Userscript/Disable page close confirmation.storage.json @@ -0,0 +1 @@ +{"ts":1642196591002,"data":{}} \ No newline at end of file diff --git a/vivaldi/Userscript/Disable page close confirmation.user.js b/vivaldi/Userscript/Disable page close confirmation.user.js new file mode 100755 index 0000000..21d3aeb --- /dev/null +++ b/vivaldi/Userscript/Disable page close confirmation.user.js @@ -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); + } + }; +})(); diff --git a/vivaldi/Userscript/Google I'm Feeling Lucky Redirect.options.json b/vivaldi/Userscript/Google I'm Feeling Lucky Redirect.options.json new file mode 100755 index 0000000..2a7aa05 --- /dev/null +++ b/vivaldi/Userscript/Google I'm Feeling Lucky Redirect.options.json @@ -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"}} \ No newline at end of file diff --git a/vivaldi/Userscript/Google I'm Feeling Lucky Redirect.storage.json b/vivaldi/Userscript/Google I'm Feeling Lucky Redirect.storage.json new file mode 100755 index 0000000..9db2591 --- /dev/null +++ b/vivaldi/Userscript/Google I'm Feeling Lucky Redirect.storage.json @@ -0,0 +1 @@ +{"ts":1645628827820,"data":{}} \ No newline at end of file diff --git a/vivaldi/Userscript/Google I'm Feeling Lucky Redirect.user.js b/vivaldi/Userscript/Google I'm Feeling Lucky Redirect.user.js new file mode 100755 index 0000000..42b96a2 --- /dev/null +++ b/vivaldi/Userscript/Google I'm Feeling Lucky Redirect.user.js @@ -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; diff --git a/vivaldi/Userscript/RPS Night Mode.options.json b/vivaldi/Userscript/RPS Night Mode.options.json new file mode 100755 index 0000000..2c3b724 --- /dev/null +++ b/vivaldi/Userscript/RPS Night Mode.options.json @@ -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"}} \ No newline at end of file diff --git a/vivaldi/Userscript/RPS Night Mode.storage.json b/vivaldi/Userscript/RPS Night Mode.storage.json new file mode 100755 index 0000000..b0e1d14 --- /dev/null +++ b/vivaldi/Userscript/RPS Night Mode.storage.json @@ -0,0 +1 @@ +{"ts":1665846673062,"data":{}} \ No newline at end of file diff --git a/vivaldi/Userscript/RPS Night Mode.user.js b/vivaldi/Userscript/RPS Night Mode.user.js new file mode 100755 index 0000000..ebb7087 --- /dev/null +++ b/vivaldi/Userscript/RPS Night Mode.user.js @@ -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;} +`); diff --git a/vivaldi/Userscript/Tampermonkey.global.json b/vivaldi/Userscript/Tampermonkey.global.json new file mode 100755 index 0000000..e60a5aa --- /dev/null +++ b/vivaldi/Userscript/Tampermonkey.global.json @@ -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"} \ No newline at end of file diff --git a/vivaldi/Userscript/Vivaldi Forum Tweaks.options.json b/vivaldi/Userscript/Vivaldi Forum Tweaks.options.json new file mode 100755 index 0000000..2c257cc --- /dev/null +++ b/vivaldi/Userscript/Vivaldi Forum Tweaks.options.json @@ -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"}} \ No newline at end of file diff --git a/vivaldi/Userscript/Vivaldi Forum Tweaks.storage.json b/vivaldi/Userscript/Vivaldi Forum Tweaks.storage.json new file mode 100755 index 0000000..1b89024 --- /dev/null +++ b/vivaldi/Userscript/Vivaldi Forum Tweaks.storage.json @@ -0,0 +1 @@ +{"ts":1672497325995,"data":{}} \ No newline at end of file diff --git a/vivaldi/Userscript/Vivaldi Forum Tweaks.user.js b/vivaldi/Userscript/Vivaldi Forum Tweaks.user.js new file mode 100755 index 0000000..55784b0 --- /dev/null +++ b/vivaldi/Userscript/Vivaldi Forum Tweaks.user.js @@ -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;} +`); diff --git a/vivaldi/Userscript/YouTube fast fullscreen toggle.options.json b/vivaldi/Userscript/YouTube fast fullscreen toggle.options.json new file mode 100755 index 0000000..a7df49a --- /dev/null +++ b/vivaldi/Userscript/YouTube fast fullscreen toggle.options.json @@ -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"}} \ No newline at end of file diff --git a/vivaldi/Userscript/YouTube fast fullscreen toggle.storage.json b/vivaldi/Userscript/YouTube fast fullscreen toggle.storage.json new file mode 100755 index 0000000..979795f --- /dev/null +++ b/vivaldi/Userscript/YouTube fast fullscreen toggle.storage.json @@ -0,0 +1 @@ +{"ts":1616100197540,"data":{}} \ No newline at end of file diff --git a/vivaldi/Userscript/YouTube fast fullscreen toggle.user.js b/vivaldi/Userscript/YouTube fast fullscreen toggle.user.js new file mode 100755 index 0000000..5f6fb75 --- /dev/null +++ b/vivaldi/Userscript/YouTube fast fullscreen toggle.user.js @@ -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`) +})(); diff --git a/vivaldi/Userscript/index.html b/vivaldi/Userscript/index.html new file mode 100644 index 0000000..1b225c9 --- /dev/null +++ b/vivaldi/Userscript/index.html @@ -0,0 +1,58 @@ + + + + + + + Userscript + + + +

Userscript

+ ..
+[ 981 Dec 31 14:51]  Absolute Enable Right Click & Copy.options.json
+[  30 Dec 31 14:51]  Absolute Enable Right Click & Copy.storage.json
+[6.3K Dec 27  0:03]  Absolute Enable Right Click & Copy.user.js
+[ 908 Dec 31 14:51]  Disable page close confirmation.options.json
+[  30 Dec 31 14:51]  Disable page close confirmation.storage.json
+[ 834 Jan 14  2022]  Disable page close confirmation.user.js
+[ 920 Dec 31 14:51]  Google I'm Feeling Lucky Redirect.options.json
+[  30 Dec 31 14:51]  Google I'm Feeling Lucky Redirect.storage.json
+[ 899 Dec 31 14:12]  Google I'm Feeling Lucky Redirect.user.js
+[ 889 Dec 31 14:51]  RPS Night Mode.options.json
+[  30 Dec 31 14:51]  RPS Night Mode.storage.json
+[1.8K Dec 31 14:43]  RPS Night Mode.user.js
+[2.0K Dec 31 14:51]  Tampermonkey.global.json
+[ 908 Dec 31 14:51]  Vivaldi Forum Tweaks.options.json
+[  30 Dec 31 14:51]  Vivaldi Forum Tweaks.storage.json
+[3.4K Dec 31 14:40]  Vivaldi Forum Tweaks.user.js
+[ 885 Dec 31 14:51]  YouTube fast fullscreen toggle.options.json
+[  30 Dec 31 14:51]  YouTube fast fullscreen toggle.storage.json
+[5.2K Sep 23  2021]  YouTube fast fullscreen toggle.user.js
+

+

+

+ +0 directories, 19 files +

+

+ diff --git a/vivaldi/index.html b/vivaldi/index.html index f2f99a9..b07d0e5 100644 --- a/vivaldi/index.html +++ b/vivaldi/index.html @@ -32,12 +32,13 @@ [   0 Sep 11  0:32]  Mods
[   0 Nov 13 15:22]  SDThumbs
[   0 Nov 13 15:24]  user_files
+[   0 Dec 31 16:50]  Userscript
[ 25K Jul  6 18:21]  keyboard.html


-3 directories, 1 file +4 directories, 1 file