Skip to content

Commit 90b0937

Browse files
authored
Update README.md
1 parent 6dba799 commit 90b0937

File tree

1 file changed

+70
-62
lines changed

1 file changed

+70
-62
lines changed

Picviewer CE+/README.md

Lines changed: 70 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -140,69 +140,77 @@ Feel free to share your own custom rules on Greasy Fork!
140140
})();
141141
```
142142

143-
<details>
144-
<summary><h2>Advance rule wizard</h2></summary>
145-
146-
There are two types of rules available:
147-
148-
+ JSON (simple mode)
149-
150-
These rules are written in JSON format and can be imported online through [Discussions](https://github.com/hoothin/UserScripts/discussions) or [Reddit](https://www.reddit.com/r/PicviewerCE).
151-
They won't limited by websites that have a strict Content Security Policy that disallows unsafe-eval.
152-
153-
+ JSON params
154-
- name
155-
156-
`"name": "rule name"`
157-
158-
Name of the rule
159-
- url
160-
161-
`"url": "^https://google\\.com"`
162-
163-
Regular expression used to match the site URL.
164-
- src
165-
166-
`"src": "^https://image\\.xx\\.com"`
167-
168-
Regular expression used to match the image src
169-
- r
170-
171-
`"r": "/(.*)\\d+/i"` or `"r": "thumb"`
172-
173-
Simple string or regular expression used to replace the image src from
174-
- s
175-
176-
`"s": "$1"`
177-
178-
Replace the image src to
179-
- ext
180-
181-
`"ext": "previous"`
182-
183-
Capture nearby image element when the mouse hovers over a non-image element.
184-
- lazyAttr
185-
186-
`"lazyAttr": "data-lazy"`
187-
188-
Lazy loaded original image URL attribute name
189-
- xhr
190-
191-
`"xhr": { "url": ".showcase__link", "query": "img[fetchpriority]" }`
192-
193-
Fetch the link above the image that matches ".showcase__link" and query the "img[fetchpriority]" on the inner page from the link.
194-
195-
+ JS (full mode)
196-
197-
These rules are written in JavaScript object format. If you are not using a standalone userscript, they may be limited by websites that have a strict Content Security Policy that disallows unsafe-eval.
198-
199-
+ JS params
200-
- all mentioned above and the function type instead of string type
201-
- getImage
202-
- getExtSrc
203-
204-
Learn from https://github.com/hoothin/UserScripts/blob/master/Picviewer%20CE%2B/pvcep_rules.js
205143

144+
<details>
145+
<summary><h2 tabindex="-1" class="heading-element" dir="auto">Advance rule wizard</h2></summary>
146+
<p dir="auto">There are two types of rules available:</p>
147+
<ul dir="auto">
148+
<li>
149+
<p dir="auto">JSON (simple mode)</p>
150+
<p dir="auto">These rules are written in JSON format and can be imported online through <a href="https://github.com/hoothin/UserScripts/discussions">Discussions</a> or <a href="https://www.reddit.com/r/PicviewerCE" rel="nofollow">Reddit</a>.
151+
They won't limited by websites that have a strict Content Security Policy that disallows unsafe-eval.</p>
152+
<ul dir="auto">
153+
<li>JSON params
154+
<ul dir="auto">
155+
<li>
156+
<p dir="auto">name</p>
157+
<p dir="auto"><code>"name": "rule name"</code></p>
158+
<p dir="auto">Name of the rule</p>
159+
</li>
160+
<li>
161+
<p dir="auto">url</p>
162+
<p dir="auto"><code>"url": "^https://google\\.com"</code></p>
163+
<p dir="auto">Regular expression used to match the site URL.</p>
164+
</li>
165+
<li>
166+
<p dir="auto">src</p>
167+
<p dir="auto"><code>"src": "^https://image\\.xx\\.com"</code></p>
168+
<p dir="auto">Regular expression used to match the image src</p>
169+
</li>
170+
<li>
171+
<p dir="auto">r</p>
172+
<p dir="auto"><code>"r": "/(.*)\\d+/i"</code> or <code>"r": "thumb"</code></p>
173+
<p dir="auto">Simple string or regular expression used to replace the image src from</p>
174+
</li>
175+
<li>
176+
<p dir="auto">s</p>
177+
<p dir="auto"><code>"s": "$1"</code></p>
178+
<p dir="auto">Replace the image src to</p>
179+
</li>
180+
<li>
181+
<p dir="auto">ext</p>
182+
<p dir="auto"><code>"ext": "previous"</code></p>
183+
<p dir="auto">Capture nearby image element when the mouse hovers over a non-image element.</p>
184+
</li>
185+
<li>
186+
<p dir="auto">lazyAttr</p>
187+
<p dir="auto"><code>"lazyAttr": "data-lazy"</code></p>
188+
<p dir="auto">Lazy loaded original image URL attribute name</p>
189+
</li>
190+
<li>
191+
<p dir="auto">xhr</p>
192+
<p dir="auto"><code>"xhr": { "url": ".showcase__link", "query": "img[fetchpriority]" }</code></p>
193+
<p dir="auto">Fetch the link above the image that matches ".showcase__link" and query the "img[fetchpriority]" on the inner page from the link.</p>
194+
</li>
195+
</ul>
196+
</li>
197+
</ul>
198+
</li>
199+
<li>
200+
<p dir="auto">JS (full mode)</p>
201+
<p dir="auto">These rules are written in JavaScript object format. If you are not using a standalone userscript, they may be limited by websites that have a strict Content Security Policy that disallows unsafe-eval.</p>
202+
<ul dir="auto">
203+
<li>JS params
204+
<ul dir="auto">
205+
<li>all mentioned above and the function type instead of string type</li>
206+
<li>getImage</li>
207+
<li>getExtSrc</li>
208+
</ul>
209+
</li>
210+
</ul>
211+
<p dir="auto">Learn from <a href="https://github.com/hoothin/UserScripts/blob/master/Picviewer%20CE%2B/pvcep_rules.js">https://github.com/hoothin/UserScripts/blob/master/Picviewer%20CE%2B/pvcep_rules.js</a></p>
212+
</li>
213+
</ul>
206214
</details>
207215

208216
## Blank Gallery Page

0 commit comments

Comments
 (0)