1
0
mirror of https://github.com/chylex/Userscripts.git synced 2025-09-16 02:32:10 +02:00

Compare commits

...

10 Commits

7 changed files with 94 additions and 70 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.idea

View File

@@ -0,0 +1,20 @@
// ==UserScript==
// @name Patreon - Click Anywhere to Close Image Dialog
// @description Close modal image dialog by clicking anywhere on the page.
// @version 1
// @license MPL-2.0
// @namespace https://chylex.com
// @homepageURL https://github.com/chylex/Userscripts
// @supportURL https://github.com/chylex/Userscripts/issues
// @include https://www.patreon.com/*
// @run-at document-idle
// @grant none
// ==/UserScript==
document.body.addEventListener("click", e => {
if (e.target.tagName === "IMG" && e.target.getAttribute("data-tag") === "lightboxImage") {
document.querySelector("[data-tag='close']")?.click();
e.preventDefault();
e.stopPropagation();
}
});

View File

@@ -44,6 +44,15 @@ Before you [report an issue](https://github.com/chylex/Userscripts/issues/new) (
</tr> </tr>
</tbody> </tbody>
</table> </table>
<table>
<tbody>
<tr>
<th width="110px" rowspan="1">Patreon</th>
<td width="325px"><a href="#click-anywhere-to-close-image-dialog">Click Anywhere to Close Image Dialog</a></td>
<td>Script</td>
</tr>
</tbody>
</table>
<table> <table>
<tbody> <tbody>
<tr> <tr>
@@ -66,11 +75,7 @@ Before you [report an issue](https://github.com/chylex/Userscripts/issues/new) (
<tbody> <tbody>
<tr> <tr>
<th width="110px" rowspan="5">YouTube</th> <th width="110px" rowspan="5">YouTube</th>
<td width="325px"><a href="#activity-check-removal">Activity Check Removal</a></td> <td width="325px"><a href="#block-youtube-playlists">Block YouTube Playlists</a></td>
<td>Script</td>
</tr>
<tr>
<td><a href="#block-youtube-playlists">Block YouTube Playlists</a></td>
<td>Script</td> <td>Script</td>
</tr> </tr>
<tr> <tr>
@@ -81,6 +86,10 @@ Before you [report an issue](https://github.com/chylex/Userscripts/issues/new) (
<td><a href="#hide-youtube-seek-bar--duration">Hide YouTube Seek Bar & Duration</a></td> <td><a href="#hide-youtube-seek-bar--duration">Hide YouTube Seek Bar & Duration</a></td>
<td>Script</td> <td>Script</td>
</tr> </tr>
<tr>
<td><a href="#redirect-youtube-shorts">Redirect YouTube Shorts</a></td>
<td>Script</td>
</tr>
<tr> <tr>
<td><a href="#theater-fullscreen--transparent-chat">Theater Fullscreen + Transparent Chat</a></td> <td><a href="#theater-fullscreen--transparent-chat">Theater Fullscreen + Transparent Chat</a></td>
<td>Script</td> <td>Script</td>
@@ -131,6 +140,17 @@ Adds a button to load all pages in the [Crashes](https://openeye.openmods.info/c
\- \-
\[ [Source code](https://github.com/chylex/Userscripts/blob/master/OpenEye/LoadAllPages.user.js) \] \[ [Source code](https://github.com/chylex/Userscripts/blob/master/OpenEye/LoadAllPages.user.js) \]
---
### Patreon
#### Click Anywhere to Close Image Dialog
Close modal image dialog by clicking anywhere on the page.
\[ [Automatically updated](https://github.com/chylex/Userscripts/raw/master/Patreon/ClickAnywhereToCloseImageDialog.user.js) \]
\-
\[ [Manually updated](https://github.com/chylex/Userscripts/raw/6b2f3698dc7082a57afa82470422f5c3418f1938/Patreon/ClickAnywhereToCloseImageDialog.user.js) \]
\-
\[ [Source code](https://github.com/chylex/Userscripts/blob/master/Patreon/ClickAnywhereToCloseImageDialog.user.js) \]
--- ---
### Reddit ### Reddit
@@ -154,19 +174,11 @@ Overlays Twitch chat over the video to save space. Includes many customizations
--- ---
### YouTube ### YouTube
#### Activity Check Removal
Removes activity check that interrupts video playback. **This script is obsolete**.
\[ [Automatically updated](https://github.com/chylex/Userscripts/raw/master/YouTube/ActivityCheckRemoval.user.js) \]
\-
\[ [Manually updated](https://github.com/chylex/Userscripts/raw/2ddfdcd8cffb796830ff04847f43f2bf91fb0ffc/YouTube/ActivityCheckRemoval.user.js) \]
\-
\[ [Source code](https://github.com/chylex/Userscripts/blob/master/YouTube/ActivityCheckRemoval.user.js) \]
#### Block YouTube Playlists #### Block YouTube Playlists
Removes playlists from YouTube video URLs. Removes playlists from YouTube video URLs.
\[ [Automatically updated](https://github.com/chylex/Userscripts/raw/master/YouTube/BlockPlaylists.user.js) \] \[ [Automatically updated](https://github.com/chylex/Userscripts/raw/master/YouTube/BlockPlaylists.user.js) \]
\- \-
\[ [Manually updated](https://github.com/chylex/Userscripts/raw/b74c26ed01640db4f6d0a06f67d6e25627fb07be/YouTube/BlockPlaylists.user.js) \] \[ [Manually updated](https://github.com/chylex/Userscripts/raw/98097ef8c14ab84ff0dc7463bbe55a363890bb6d/YouTube/BlockPlaylists.user.js) \]
\- \-
\[ [Source code](https://github.com/chylex/Userscripts/blob/master/YouTube/BlockPlaylists.user.js) \] \[ [Source code](https://github.com/chylex/Userscripts/blob/master/YouTube/BlockPlaylists.user.js) \]
@@ -186,6 +198,14 @@ Hides all mentions of video durations by default. Press 'AltGr' to toggle.
\- \-
\[ [Source code](https://github.com/chylex/Userscripts/blob/master/YouTube/HideSeekBarAndDuration.user.js) \] \[ [Source code](https://github.com/chylex/Userscripts/blob/master/YouTube/HideSeekBarAndDuration.user.js) \]
#### Redirect YouTube Shorts
Redirects YouTube shorts to normal video URLs.
\[ [Automatically updated](https://github.com/chylex/Userscripts/raw/master/YouTube/RedirectShorts.user.js) \]
\-
\[ [Manually updated](https://github.com/chylex/Userscripts/raw/035aed7554c89fee66a6278f4fcf73292821b7f5/YouTube/RedirectShorts.user.js) \]
\-
\[ [Source code](https://github.com/chylex/Userscripts/blob/master/YouTube/RedirectShorts.user.js) \]
#### Theater Fullscreen + Transparent Chat #### Theater Fullscreen + Transparent Chat
In theater mode, it expands video to full screen, makes chat transparent and overlays it over the video. Note that colors of images in chat will be inverted, and the player controls may behave strangely. **Requires classic YouTube layout,** you can use the third-party [Youtube - Restore Classic](https://greasyfork.org/en/scripts/34818-youtube-restore-classic) script for that. In theater mode, it expands video to full screen, makes chat transparent and overlays it over the video. Note that colors of images in chat will be inverted, and the player controls may behave strangely. **Requires classic YouTube layout,** you can use the third-party [Youtube - Restore Classic](https://greasyfork.org/en/scripts/34818-youtube-restore-classic) script for that.
\[ [Automatically updated](https://github.com/chylex/Userscripts/raw/master/YouTube/TheaterFullscreenTransparentChat.user.js) \] \[ [Automatically updated](https://github.com/chylex/Userscripts/raw/master/YouTube/TheaterFullscreenTransparentChat.user.js) \]
@@ -203,7 +223,7 @@ In theater mode, it expands video to full screen, makes chat transparent and ove
Reverts to the old Vector design. Reverts to the old Vector design.
\[ [Automatically updated](https://github.com/chylex/Userscripts/raw/master/Wikipedia/OldDesign.user.js) \] \[ [Automatically updated](https://github.com/chylex/Userscripts/raw/master/Wikipedia/OldDesign.user.js) \]
\- \-
\[ [Manually updated](https://github.com/chylex/Userscripts/raw/2b6bad9b2ba7a25c99e5f5b705de61e3661e89ef/Wikipedia/OldDesign.user.js) \] \[ [Manually updated](https://github.com/chylex/Userscripts/raw/bd10edeb73ded1b0af0c4c715ef4399e9db248e8/Wikipedia/OldDesign.user.js) \]
\- \-
\[ [Source code](https://github.com/chylex/Userscripts/blob/master/Wikipedia/OldDesign.user.js) \] \[ [Source code](https://github.com/chylex/Userscripts/blob/master/Wikipedia/OldDesign.user.js) \]

View File

@@ -2,14 +2,14 @@
// @name Old Wikipedia Design // @name Old Wikipedia Design
// @description Reverts to the old Vector design. // @description Reverts to the old Vector design.
// @author Vusys, chylex // @author Vusys, chylex
// @version 1 // @version 2
// @license MIT // @license MIT
// @namespace https://chylex.com // @namespace https://chylex.com
// @homepageURL https://github.com/chylex/Userscripts // @homepageURL https://github.com/chylex/Userscripts
// @supportURL https://github.com/chylex/Userscripts/issues // @supportURL https://github.com/chylex/Userscripts/issues
// @include https://*.wikipedia.org/* // @include https://*.wikipedia.org/*
// @exclude https://*.wikipedia.org/ // @exclude https://*.wikipedia.org/
// @run-at document-end // @run-at document-start
// @grant none // @grant none
// ==/UserScript== // ==/UserScript==
@@ -25,9 +25,11 @@
return; return;
} }
for (const a of document.getElementsByTagName("a")) { document.addEventListener("DOMContentLoaded", function() {
if (a.hostname.includes("wikipedia.org")) { for (const a of document.getElementsByTagName("a")) {
a.href = fixUrl(a.href); if (a.hostname.includes("wikipedia.org")) {
a.href = fixUrl(a.href);
}
} }
} });
})(); })();

View File

@@ -1,35 +0,0 @@
// ==UserScript==
// @name YouTube Activity Check Removal
// @description Removes activity check that interrupts video playback.
// @version 1
// @license MPL-2.0
// @namespace https://chylex.com
// @homepageURL https://github.com/chylex/Userscripts
// @supportURL https://github.com/chylex/Userscripts/issues
// @include https://youtube.com/*
// @include https://*.youtube.com/*
// @run-at document-end
// @grant none
// @noframes
// ==/UserScript==
var timeout = 0;
var check = setInterval(function(){
if (_yt_www.J){
clearInterval(check);
var prev = _yt_www.J;
_yt_www.J = function(cls){
if (cls && cls.startsWith("youthere-")){
return null;
}
return prev.apply(this, arguments);
};
}
else if (++timeout > 500){ // average should be about 5-10
clearInterval(check);
}
}, 1);

View File

@@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name Block YouTube Playlists // @name Block YouTube Playlists
// @description Removes playlists from YouTube video URLs. // @description Removes playlists from YouTube video URLs.
// @version 1 // @version 2
// @license MPL-2.0 // @license MPL-2.0
// @namespace https://chylex.com // @namespace https://chylex.com
// @homepageURL https://github.com/chylex/Userscripts // @homepageURL https://github.com/chylex/Userscripts
@@ -13,18 +13,11 @@
// @noframes // @noframes
// ==/UserScript== // ==/UserScript==
if (location.pathname == "/watch" && location.search.includes("&list=")){ function redirectPlaylist() {
history.replaceState({}, document.title, location.search.replace(/&list=(.*)/, "")); if (location.pathname === "/watch" && location.search.includes("&list=")) {
location.reload(); location.replace(location.href.replace(/&list=(.*)/, ""));
}
} }
document.addEventListener("spfclick", function(e){ redirectPlaylist();
var url = e.detail.url; document.addEventListener("yt-navigate-start", redirectPlaylist);
if (url.includes("youtube.com/watch?") && url.includes("&list=")){
// forces a normal page load
e.preventDefault();
e.stopPropagation();
e.stopImmediatePropagation();
}
}, true);

View File

@@ -0,0 +1,23 @@
// ==UserScript==
// @name Redirect YouTube Shorts
// @description Redirects YouTube shorts to normal video URLs.
// @version 1
// @license MPL-2.0
// @namespace https://chylex.com
// @homepageURL https://github.com/chylex/Userscripts
// @supportURL https://github.com/chylex/Userscripts/issues
// @include https://youtube.com/*
// @include https://*.youtube.com/*
// @run-at document-start
// @grant none
// @noframes
// ==/UserScript==
function redirectShort() {
if (location.pathname.startsWith("/shorts/")) {
location.replace(location.href.replace("/shorts/", "/watch?v="));
}
}
redirectShort();
document.addEventListener("yt-navigate-start", redirectShort);