mirror of
https://github.com/chylex/Userscripts.git
synced 2025-08-17 15:31:46 +02:00
Compare commits
2 Commits
7319ee255e
...
bcaebeca36
Author | SHA1 | Date | |
---|---|---|---|
bcaebeca36
|
|||
6b2f3698dc
|
20
Patreon/ClickAnywhereToCloseImageDialog.user.js
Normal file
20
Patreon/ClickAnywhereToCloseImageDialog.user.js
Normal 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();
|
||||||
|
}
|
||||||
|
});
|
20
README.md
20
README.md
@@ -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>
|
||||||
@@ -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
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user