You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Picviewer CE+/README.md
+70-62Lines changed: 70 additions & 62 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -140,69 +140,77 @@ Feel free to share your own custom rules on Greasy Fork!
140
140
})();
141
141
```
142
142
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.
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
<pdir="auto">There are two types of rules available:</p>
147
+
<uldir="auto">
148
+
<li>
149
+
<pdir="auto">JSON (simple mode)</p>
150
+
<pdir="auto">These rules are written in JSON format and can be imported online through <ahref="https://github.com/hoothin/UserScripts/discussions">Discussions</a> or <ahref="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>
<pdir="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
+
<pdir="auto">JS (full mode)</p>
201
+
<pdir="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
+
<uldir="auto">
203
+
<li>JS params
204
+
<uldir="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
+
<pdir="auto">Learn from <ahref="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>
0 commit comments