-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
457 lines (408 loc) · 17.1 KB
/
demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>HrefTaker Demo</title>
<style>
html {
display: flex;
flex-direction: column;
align-items: center;
}
body {
max-width: 1280px;
padding-bottom: 45px;
}
body {
display: grid;
}
body > div {
overflow: auto;
}
.readme {
position: fixed;
bottom: 0;
right: 0;
padding: 2px 8px;
margin: 1px;
color: #a9a9a9;
text-decoration: none;
}
</style>
<script defer>
if (localStorage.getItem("ujs-href-taker") === null) {
localStorage.setItem("ujs-href-taker", JSON.stringify({console_vars: true}));
}
</script>
<script defer src="./src/main.js" type="module"></script>
<script defer>
const getShadowRoot = () => document.querySelector("#href-taker-outer-shadow-wrapper")?.shadowRoot;
globalThis.getShadowRoot = getShadowRoot();
function setInputValue(name, value) {
const shadowRoot = getShadowRoot();
if (!shadowRoot) {
return;
}
const input = shadowRoot.querySelector(`input[name="${name}"]`);
input.value = value;
input.dispatchEvent(new Event("input"));
}
function setCheckboxValue(name, checked) {
const shadowRoot = getShadowRoot();
if (!shadowRoot) {
return;
}
const input = shadowRoot.querySelector(`input[name="${name}"]`);
if (checked === undefined) {
checked = !input.checked;
}
input.checked = checked;
input.dispatchEvent(new Event("change"));
}
globalThis.setInputValue = setInputValue;
globalThis.setCheckboxValue = setCheckboxValue;
</script>
</head>
<body>
<a class="readme" title="Open Readme" href="https://github.com/AlttiRi/href-taker#hreftaker" target="_blank" rel="noopener"><i>i</i></a>
<script defer>
const headerHtmlText = `
<header>
<style>
header {
display: flex;
justify-content: start;
padding: 16px;
border: 2px solid gray;
max-width: 580px;
}
span[onclick] {
cursor: pointer;
text-decoration: underline;
}
span[onclick]:active {
text-shadow: gray 0 0 1px;
user-select: none;
}
</style>
<div>
<p>Here is the webpage to demonstrate how the <a href="https://github.com/AlttiRi/href-taker/blob/master/href-taker.user.js" target="_blank">userscript</a> works.</p>
<p>Click on the button to open the popup.</p>
<p><button onclick="hreftaker.showPopup()">Show popup</button></p>
<br>
<p><i>Remember, you can move the popup.</i></p>
<hr>
<p>
By default, it parses URLs from <span onclick="setInputValue('input_selector', 'body')"><code>body</code></span> element.
<br>
In <b>Extra Settings</b> you can specify the selector.
<br>
For example, set <b>Selector</b> input value to <span onclick="setInputValue('input_selector', '.content');"><code>.content</code></span>.
</p>
<p><span onclick="setCheckboxValue('ignore_first_party')">1st party links</span> are displayed, by default.</p>
<p>
To list links, for example, from Twitter and ArtStation put in <b>Only</b> input:
<br>
<span onclick="setInputValue('input_only', 'twitter artstation')"><code>twitter artstation</code></span>.
</p>
<p>
To list YouTube videos put in in <b>Only</b> input:
<br>
<span onclick="setInputValue('input_only', 'youtube.com/shorts youtube.com/watch youtu.be')"><code>youtube.com/shorts youtube.com/watch youtu.be</code></span>.
</p>
<p>
To list everything except example.com and wikipedia.org sites just put in <b>Ignore</b> input:
<br>
<span onclick="setInputValue('input_ignore', 'example.com wikipedia.org')"><code>example.com wikipedia.org</code></span>.
</p>
<p>
To list everything make both
<span onclick="setInputValue('input_only', '')">input <b>Only</b></span>
and
<span onclick="setInputValue('input_ignore', '')">input <b>Ignore</b></span>
empty.
</p>
<hr>
<p><b>The below are listed different <i>example posts</i> to parse the URLs from them with the popup.</b></p>
<hr>
</div>
</header>`;
const headerWrapper = document.createElement("div");
headerWrapper.attachShadow({mode: "open"});
headerWrapper.shadowRoot.innerHTML = headerHtmlText;
document.body.prepend(headerWrapper);
</script>
<div class="post" id="main">
<h2>
<a href="https://github.com/AlttiRi/href-taker" target="_blank">HrefTaker</a>
</h2>
<div class="content">
<p>The userscript that adds a popup to collect URLs from a web page. It's mainly aimed for static websites.</p>
<p>It grabs the links from anchors' hrefs (an HTML tag) as well as from non-hyperlink visible text.</p>
See more here: <a href="https://github.com/AlttiRi/href-taker#hreftaker" target="_blank">https://github.com/AlttiRi/href-taker#hreftaker</a>
<p>Raw JS:<a href="https://github.com/AlttiRi/href-taker/raw/master/href-taker.user.js" target="_blank">href-taker.user.js</a></p>
</div>
<hr>
</div>
<div class="post" id="examples">
<h2>
Simple examples
</h2>
<div class="content">
<p>The follow links are in A tag:</p>
<p><a href="https://github.com" rel="noreferrer noopener nofollow" target="_blank">GitHub (https://github.com)</a></p>
<p><a href="http://github.com" rel="noreferrer noopener nofollow" target="_blank">GitHub (<b>http</b>://github.com)</a></p>
<p><a href="http://example.com/" rel="noreferrer noopener nofollow" target="_blank"><b>http</b>://example.com/</a></p>
<p><a href="https://example.com/" rel="noreferrer noopener nofollow" target="_blank">https://example.com<b>/</b></a></p>
<p><a href="https://example.com" rel="noreferrer noopener nofollow" target="_blank">https://example.com</a></p>
<p><a href="https://example.com/test" rel="noreferrer noopener nofollow" target="_blank">https://example.com/test</a></p>
<p><a href="https://www.cloudflare.com">https://www.cloudflare.com</a></p>
</div>
<hr>
</div>
<div class="post" id="text">
<h2>
Text URLs
</h2>
<div class="content">
<p>Online demo: https://alttiri.github.io/href-taker/demo</p>
<p>Readme link: https://github.com/AlttiRi/href-taker#hreftaker</p>
<p>Made by AlttiRi. The profile URL: <span>https://github.com/AlttiRi</span></p>
<br>
<p>KeepLister Readme: https://github.com/AlttiRi/keep-lister#keeplister</p>
<p>KeepLister (Windows 10 scan): https://alttiri.github.io/keep-lister/?filepath=https://alttiri.github.io/json-flat-scans/windows-admin.json.gz</p>
<br>
<p>The follow will be ignored:</p>
<p>DuckDuckGo: https://duckduckgo.com/</p>
<p>YouTube: youtube.com</p>
<br>
<p>It will be parsed:</p>
<p>https://duckduckgo.com/?q=duckduckgo</p>
<p>youtube.com/@SpaceX</p>
</div>
<hr>
</div>
<div class="post" id="weather-1">
<div class="content">
https://www.windy.com/?77.777,-52.222,4
</div>
<hr>
</div>
<div class="post" id="html">
<h2>
<a href="">Plain HTML</a>
</h2>
<div class="content">
<span>
<p>DyE - Fantasy - Official Video<br><a href="https://www.youtube.com/watch?v=6QFwo57WKwg" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://www.</span><span class="">youtube.com/watch?v=6QFwo57WKwg</span><span class="invisible"></span></a></p>
</span>
<span>
<p>Flairs - Truckers Delight (Official music video)<br><a href="https://www.youtube.com/watch?v=egcXvqiho4w" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://www.</span><span class="">youtube.com/watch?v=egcXvqiho4w</span><span class="invisible"></span></a></p>
</span>
</div>
<hr>
</div>
<div class="post" id="accuweather-1">
<h2>
AccuWeather TW
</h2>
<div class="content">
<p><i>(the direct link with "fake" bit.ly <b>text</b>)</i></p>
<p><a href="https://www.accuweather.com/en/space-news/live-news/astronomy-news-current-space-events-2023/1480879" rel="noreferrer noopener nofollow" target="_blank">https://bit.ly/3IJnG7d</a></p>
<p>https://twitter.com/accuweather/status/1631393812911104000</p>
</div>
<hr>
</div>
<div class="post" id="ome">
<h2>One more example</h2>
<div class="content">
<a href="https://www.artstation.com/artwork/nQKgdr" rel="noreferrer noopener nofollow" target="_blank">artstation/nQKgdr</a>
<br>
HTTPS://EXAMPLE.COM/UPPER_CASED
<br>
https://www.artstation.com/artwork/Vyo9V4
<br>
2b (https://www.artstation.com/artwork/J6Xdm)
<br>
https://en.wikipedia.org/wiki/Parenthesis_(disambiguation)
<br>
[Markdown](https://en.wikipedia.org/wiki/Markdown)
<br>
[https://en.wikipedia.org/wiki/HTML](https://www.wikipedia.org/wiki/HTML)
<br>
[https://www.wikipedia.org/wiki/CSS](https://en.wikipedia.org/wiki/CSS)
<br>
[lofi hip hop radio - beats to relax/study to](https://youtu.be/jfKfPfyJRdk)
<br>
[SpaceX Falcon 9 Starlink Group 4-13 launch and landing](https://www.youtube.com/shorts/xuAEv0am9A0)
<br>
[Starlink Mission](https://www.youtube.com/watch?v=BAkApUbevaA)
<br>
<a href="https://www.youtube.com/watch?v=k3WkJq478To" rel="noreferrer noopener nofollow" target="_blank">Synthwave/Electric Mixtape I | For Study/Relax</a>
</div>
<hr>
</div>
<div class="post" id="uuBETyA_yxc">
<h2>
<a href="https://www.youtube.com/watch?v=uuBETyA_yxc" rel="noreferrer noopener nofollow" target="_blank">U Got That | FULL VERSION [MMV]</a>
</h2>
<div class="content" style="white-space: pre">
U Got that MMV
========Gesugao ship girl illustration.=========
■Artist : ebiblue (海老ブルー)
□Twitter : https://twitter.com/ebiblue
□instagram : https://www.instagram.com/ebiblue_gesu/
□Youtube : https://www.youtube.com/c/ebiblue_Official
□Pixiv : https://www.pixiv.net/users/379606
====================================
2 HOUR VERSION https://www.youtube.com/watch?v=g2Ga75ckv9c
</div>
<hr>
</div>
<div class="post" id="w">
<h2>
<a href="https://www.youtube.com/watch?v=z_HWtzUHm6s" rel="noreferrer noopener nofollow" target="_blank">[SFM] Shrekophone</a>
</h2>
<div class="content" style="white-space: pre">
layers.mpeg
Credits: De Hofnar - Zonnestraal (MÖWE Remix)
https://itunes.apple.com/us/album/zonnestraal-single/id768833593
I don't own this song.
</div>
<hr>
</div>
<h3>Twitter posts with <code>\n</code>:</h3>
<div id="1614741377862209537">
<h4>
<a href="https://twitter.com/ehhypnohub/status/1614741377862209537">1614741377862209537</a> by <a href="https://twitter.com/ehhypnohub">ehhypnohub</a>
</h4>
<div class="content">Stream work! Tracer and Widowmaker Orange Eyes.
Widowmakers plan to capture Tracer backfires a bit. But Tracer needs to be careful. Don't worry I'm sure Sombra or someone will come get them.
Catbox
https://files.catbox.moe/vcywoq.png
Mega
https://mega.nz/folder/EOMEjaKD#Zv-EoPhENYEvbtEvA897hw</div>
<hr>
<div>2023.01.15 21:48:39</div>
<hr>
</div>
<br>
<div id="1628475447083208709">
<h4>
<a href="https://twitter.com/ehhypnohub/status/1628475447083208709">1628475447083208709</a> by <a href="https://twitter.com/ehhypnohub">ehhypnohub</a>
</h4>
<div class="content">No text or effects!
1
https://files.catbox.moe/tyowjn.png
2
https://files.catbox.moe/xn3yvh.png
3
https://files.catbox.moe/gpbalf.png
4
https://files.catbox.moe/bqtz8g.png</div>
<hr>
<div>2023.02.22 19:22:56</div>
<hr>
</div>
<br>
<h3>Twitter posts with <code>\n</code> replaced by <code><br></code></h3>
<div id="1628472824137453575">
<h4>
<a href="https://twitter.com/ehhypnohub/status/1628472824137453575" rel="noreferrer noopener nofollow" target="_blank">1628472824137453575</a> by <a href="https://twitter.com/ehhypnohub" rel="noreferrer noopener nofollow" target="_blank">ehhypnohub</a>
</h4>
<div class="content">Futaba Hypno Ring/Zombie Walk<br><br>Offering Futaba food is a good way to let her guard down, just make sure she doesn't wonder off.<br><br>No text/effects versions in the comments ⤵️<br><br>1<br>https://files.catbox.moe/6znv3a.png<br>2<br>https://files.catbox.moe/dc4gpk.png<br>3<br>https://files.catbox.moe/tuyiv8.png<br>4<br>https://files.catbox.moe/v3ecy8.png</div>
<hr>
<div>2023.02.22 19:12:31</div>
<hr>
</div>
<br>
<div id="1628473837854633992">
<h4>
<a href="https://twitter.com/ehhypnohub/status/1628473837854633992" rel="noreferrer noopener nofollow" target="_blank">1628473837854633992</a> by <a href="https://twitter.com/ehhypnohub" rel="noreferrer noopener nofollow" target="_blank">ehhypnohub</a>
</h4>
<div class="content">No text or effects!<br><br>1<br>https://files.catbox.moe/d790ea.png<br>2<br>https://files.catbox.moe/9pnkkt.png<br>3<br>https://files.catbox.moe/zvnhn4.png<br>4<br>https://files.catbox.moe/tto6l0.png</div>
<hr>
<div>2023.02.22 19:16:33</div>
<hr>
</div>
<br>
<div id="1631320065869074433">
<h4>
<a href="https://twitter.com/fasc1nate/status/1631320065869074433" rel="noreferrer noopener nofollow" target="_blank">1631320065869074433</a> by <a href="https://twitter.com/fasc1nate" rel="noreferrer noopener nofollow" target="_blank">fasc1nate</a>
</h4>
<div class="content">The town of Portofino, Italy. Source: http://bit.ly/3rtuf4F</div>
<hr>
<div>2023.03.02 15:46:26</div>
<hr>
</div>
<br>
<div id="1631460560314171392">
<h4>
<a href="https://twitter.com/accuweather/status/1631460560314171392" rel="noreferrer noopener nofollow" target="_blank">1631460560314171392</a> by <a href="https://twitter.com/accuweather" rel="noreferrer noopener nofollow" target="_blank">accuweather</a>
</h4>
<div class="content">The Windy City is experiencing a snowfall deficit this winter, but a big, travel-disrupting winter storm will help boost those seasonal totals later this week. https://bit.ly/3ESZ8aO</div>
<hr>
<div>2023.03.03 01:04:43</div>
<hr>
</div>
<br>
<div id="1629082259083993088">
<h4>
<a href="https://twitter.com/Windycom/status/1629082259083993088" rel="noreferrer noopener nofollow" target="_blank">1629082259083993088</a> by <a href="https://twitter.com/Windycom" rel="noreferrer noopener nofollow" target="_blank">Windycom</a>
</h4>
<div class="content">Severe storm Freddy is making landfall in #Mozambique with winds of 113km/h, 500 mm of rain, and flooding, expected in the following days. ⚠️🌧️ #freddy #storm #cyclone<br><br>Track the storm - http://bit.ly/cyclone-freddy</div>
<hr>
<div>2023.02.24 11:34:12</div>
<hr>
</div>
<br>
<div id="1625044797269450752">
<h4>
<a href="https://twitter.com/Windycom/status/1625044797269450752" rel="noreferrer noopener nofollow" target="_blank">1625044797269450752</a> by <a href="https://twitter.com/Windycom" rel="noreferrer noopener nofollow" target="_blank">Windycom</a>
</h4>
<div class="content">#CycloneGabrielle lashes the north of New Zealand with heavy rain and extreme winds that may lead to flooding. Warnings have been issued. #NZ <br><br>Track Gabrielle at - http://bit.ly/3K1yYWy</div>
<hr>
<div>2023.02.13 08:10:46</div>
<hr>
</div>
<br>
<div class="content">
<h4>Images ("img[src]"):</h4>
<div>pwbUJwD</div>
<div>
<img src="https://i.imgur.com/pwbUJwD.jpeg" alt="imgur">
</div>
<div>IP0ePF6</div>
<div>
<img src="https://i.imgur.com/IP0ePF6.jpeg" alt="imgur">
</div>
<hr>
<h4>GIFs ("img[src]"):</h4>
<div>zN8Sslu</div>
<div>
<img src="https://i.imgur.com/zN8Sslu.gif" alt="imgur">
</div>
<div>fCMDIEs</div>
<div>
<img src="https://i.imgur.com/fCMDIEs.gif" alt="imgur" data-src="https://i.imgur.com/zi3TsL4.gif">
</div>
<hr>
<h4>Videos ("video[src]"):</h4>
<div>QaF1umk</div>
<div>
<video src="https://i.imgur.com/QaF1umk.mp4" loop></video>
</div>
<div>4ZR9GWY</div>
<div>
<video src="https://i.imgur.com/4ZR9GWY.mp4" loop></video>
</div>
<h4>Videos ("video source[src]"):</h4>
<div>yrkiBQf</div>
<video id="video-id" width="auto" height="auto" loop>
<source src="https://i.imgur.com/yrkiBQf.mp4" type="video/mp4">
</video>
<hr>
</div>
</body>
</html>