-
-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathscript-finder-plus.user.js
721 lines (667 loc) · 34.3 KB
/
script-finder-plus.user.js
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
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
// ==UserScript==
// @name Script Finder+
// @name:zh-CN Script Finder 油猴脚本查找
// @description:zh-CN Script Finder 在任何网站上找到适用于该网站的 油猴脚本。
// @name:ar Script Finder البحث عن نص قرد الشحوم
// @description:ar Script Finder ابحث في أي موقع ويب ينطبق على هذا الموقع سيناريو القرد الشحوم。
// @name:bg Script Finder Търсене на скрипт на GreasyFork
// @description:bg Script Finder Намерете във всеки уебсайт, който се отнася за този уебсайт GreasyFork Script。
// @name:cs Script Finder Vyhledávání skriptů GreasyFork
// @description:cs Script Finder Vyhledejte na libovolném webu, který se tohoto webu týká GreasyFork Script。
// @name:da Script Finder GreasyFork Script-opslag
// @description:da Script Finder Find på ethvert websted, der gælder for det pågældende websted GreasyFork Script。
// @name:de Script Finder Nachschlagen von GreasyFork-Skripten
// @description:de Script Finder Finden Sie auf jeder Website, die für diese Website gilt GreasyFork-Skript。
// @name:el Script Finder Αναζήτηση σεναρίου GreasyFork
// @description:el Script Finder Βρείτε σε οποιονδήποτε ιστότοπο που ισχύει για αυτόν τον ιστότοπο Σενάριο GreasyFork。
// @name:en Script Finder GreasyFork Script Lookup
// @description:en Script Finder Find on any website that applies to that website GreasyFork Script。
// @name:eo Script Finder GreasyFork Skripto Serĉo
// @description:eo Script Finder Trovu en iu ajn retejo kiu validas por tiu retejo GreasyFork Skripto。
// @name:es Script Finder Búsqueda de guiones de GreasyFork
// @description:es Script Finder Busque en cualquier sitio web que se aplique a ese sitio web. Guión del mono de grasa。
// @name:fi Script Finder GreasyFork Script Lookup
// @description:fi Script Finder Etsi miltä tahansa verkkosivustoa, joka koskee kyseistä verkkosivustoa GreasyFork Script。
// @name:fr Script Finder Recherche de script GreasyFork
// @description:fr Script Finder Rechercher sur n’importe quel site Web qui s’applique à ce site Web Script de GreasyFork。
// @name:he Script Finder בדיקת סקריפט של גריז קוף
// @description:he Script Finder מצא בכל אתר הרלוונטי לאותו אתר סקריפט גריז קוף。
// @name:hr Script Finder Traženje skripte GreasyFork
// @description:hr Script Finder Pronađite na bilo kojoj web stranici koja se odnosi na tu web stranicu GreasyFork Script。
// @name:hu Script Finder GreasyFork Script Lookup
// @description:hu Script Finder Keresse meg az adott webhelyre vonatkozó bármely webhelyet GreasyFork Script。
// @name:id Script Finder Pencarian Skrip GreasyFork
// @description:id Script Finder Temukan di situs web mana pun yang berlaku untuk situs web tersebut Naskah Monyet Gemuk。
// @name:it Script Finder Ricerca script GreasyFork
// @description:it Script Finder Trova su qualsiasi sito Web che si applica a quel sito Web Sceneggiatura della scimmia grassa。
// @name:ja Script Finder GreasyFork スクリプトの検索
// @description:ja Script Finder その Web サイトに該当する Web サイトを検索する グリース モンキー スクリプト。
// @name:ka Script Finder GreasyFork სკრიპტის ძიება
// @description:ka Script Finder იპოვეთ ნებისმიერ ვებსაიტზე, რომელიც ეხება ამ ვებსაიტს GreasyFork Script。
// @name:ko Script Finder 그리스 원숭이 스크립트 조회
// @description:ko Script Finder 해당 웹사이트에 적용되는 웹사이트를 찾으세요. 그리스 원숭이 스크립트。
// @name:nl Script Finder GreasyFork-script opzoeken
// @description:nl Script Finder Zoek op elke website wat op die website van toepassing is GreasyFork-script。
// @name:nb Script Finder GreasyFork Script Lookup
// @description:nb Script Finder Finn på et hvilket som helst nettsted som gjelder for det nettstedet GreasyFork Script。
// @name:pl Script Finder Wyszukiwanie skryptu GreasyFork
// @description:pl Script Finder Znajdź na dowolnej stronie internetowej, która dotyczy tej witryny Smaruj skrypt małpy。
// @name:pt-BR Script Finder Pesquisa de script do GreasyFork
// @description:pt-BR Script Finder Encontre em qualquer site que se aplique a esse site Script do Macaco Graxa。
// @name:ro Script Finder Căutare Script GreasyFork
// @description:ro Script Finder Găsiți pe orice site care se aplică acelui site GreasyFork Script。
// @name:ru Script Finder Поиск сценария GreasyFork
// @description:ru Script Finder Найти на любом веб-сайте, который относится к этому веб-сайту Сценарий GreasyFork。
// @name:sk Script Finder Vyhľadávanie skriptov GreasyFork
// @description:sk Script Finder Nájdite na ľubovoľnej webovej lokalite, ktorá sa týka danej webovej lokality GreasyFork Script。
// @name:sr Script Finder Греасе Монкеи Сцрипт Лоокуп
// @description:sr Script Finder Пронађите на било којој веб локацији која се односи на ту веб локацију Греасе Монкеи Сцрипт。
// @name:sv Script Finder GreasyFork Script Lookup
// @description:sv Script Finder Hitta på vilken webbplats som helst som gäller den webbplatsen GreasyFork Script。
// @name:th Script Finder ค้นหาสคริปต์ GreasyFork
// @description:th Script Finder ค้นหาบนเว็บไซต์ใด ๆ ที่ใช้กับเว็บไซต์นั้น สคริปต์ลิงจาระบี。
// @name:tr Script Finder GreasyFork Komut Dosyası Arama
// @description:tr Script Finder Söz konusu web sitesi için geçerli olan herhangi bir web sitesinde bulun GreasyFork Komut Dosyası。
// @name:ug Script Finder مايمۇن قوليازمىسىنى ئىزدەش
// @description:ug Script Finder شۇ تور بېكەتكە ماس كېلىدىغان ھەرقانداق تور بەتنى ئىزدەڭ مايمۇن قوليازمىسى。
// @name:uk Script Finder Пошук сценарію GreasyFork
// @description:uk Script Finder Знайдіть на будь-якому веб-сайті, який стосується цього веб-сайту Сценарій GreasyFork。
// @name:vi Script Finder Tra cứu tập lệnh GreasyFork
// @description:vi Script Finder Tìm trên bất kỳ trang web nào áp dụng cho trang web đó Kịch bản khỉ mỡ。
// @name:zh-TW Script Finder 油猴腳本查找
// @description:zh-TW Script Finder 在任何網站上找到適用於該網站的 油猴腳本。
// @name:zh-HK Script Finder 油猴腳本查找
// @description:zh-HK Script Finder 在任何網站上找到適用於該網站的 油猴腳本。
// @name:fr-CA Script Finder Recherche de script GreasyFork
// @description:fr-CA Script Finder Rechercher sur n’importe quel site Web qui s’applique à ce site Web Script de GreasyFork。
// @description Script Finder allows you to find userscripts from greasyfork on any website.
// @namespace https://github.com/ChinaGodMan/UserScripts
// @version 0.1.6.80
// @author shiquda & 人民的勤务员 <[email protected]>
// @supportURL https://github.com/ChinaGodMan/UserScripts/issues
// @homepageURL https://github.com/ChinaGodMan/UserScripts
// @match *://*/*
// @connect greasyfork.org
// @icon data:image/png;base64,/9j/7gAhQWRvYmUAZIAAAAABAwAQAwIDBgAAAAAAAAAAAAAAAP/bAIQADAgICAkIDAkJDBELCgsRFQ8MDA8VGBMTFRMTGBEMDAwMDAwRDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAENCwsNDg0QDg4QFA4ODhQUDg4ODhQRDAwMDAwREQwMDAwMDBEMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwM/8IAEQgAgACAAwEiAAIRAQMRAf/EANkAAAIDAQEBAQAAAAAAAAAAAAAGBAUHAQIDCAEBAAMBAQEAAAAAAAAAAAAAAAQFBgMCARAAAAYCAQMDAwUBAAAAAAAAAAIDBAUGAQcXECAWETE2EhQ1MEAyMxU3EQABAgMDAwsPCAkFAAAAAAACAQMAEgQREwUikzUQITGRMkJS0iPTBlFicoKSorIzQ2NzFDTUNiBhcVODo7MVMEBBgbHR4yRkoXTE5BYSAAIABAQCCAUFAAAAAAAAAAECABEhEiAxIgMQQTBRYTJSgrLSc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ce2HmHebj2w8w7zce2HmHebj2w8w7zce2HmHebj2w8w7zce2HmHebiqwqorjAKoJUcuHVkNFQ2nZZMq7dEDj8mxcTeoWiL1apaS0gRVUiAmykI2ZssPKN/h3eGi7W1LuQAqCtgKlrTOm5KWbDVbeB19SaJDFFILLRWbX5LVJ+pwunN01tI0CVVXqldyTRoljvuNGiWO+40aJY77jRoljvuNGiWO+40aJY77jRoljvuNGiWNouNGiWNouNBVFFhtOy8KLK4gIpJ2BnMQfqCjsWoqbce3fdf1o9u+6/rav/2Q==
// @iconbak https://github.com/ChinaGodMan/UserScripts/raw/main/docs/icon/Scripts%20Icons/Finder.jpg
// @grant GM_xmlhttpRequest
// @grant GM_addStyle
// @license MIT
// ==/UserScript==
const translate = (function () {
const userLang = (navigator.languages && navigator.languages[0]) || navigator.language || 'en'
const strings = {
'en': {
Author: 'Author',
Installs: 'Installs',
DailyInstalls: 'Daily Installs',
Created: 'Created',
Updated: 'Updated',
Rating: 'Rating',
LoadingScripts: 'Loading scripts...',
LoadMore: 'Load more',
AllScriptsLoaded: 'All scripts loaded',
SearchPlaceholder: 'Search scripts...',
ViewOnGreasyfork: 'View on Greasyfork',
errorMessage: 'Failed to retrieve script information or there are no available scripts for this domain.',
Loading: 'Loading...',
Scripts: 'Scripts'
},
'zh-CN': {
Author: '作者',
Installs: '安装数量',
DailyInstalls: '每日安装',
Created: '创建日期',
Updated: '更新时间',
Rating: '评分',
LoadingScripts: '正在加载脚本...',
LoadMore: '加载更多',
AllScriptsLoaded: '所有脚本已加载',
SearchPlaceholder: '搜索脚本...',
ViewOnGreasyfork: '在Greasyfork查看',
errorMessage: '无法检索脚本信息或该域没有可用的脚本。',
Loading: '载入中...',
Scripts: '脚本'
},
'zh-TW': {
Author: '作者',
Installs: '安裝數量',
DailyInstalls: '每日安裝',
Created: '創建日期',
Updated: '更新日期',
Rating: '評分',
LoadingScripts: '正在載入腳本...',
LoadMore: '載入更多',
AllScriptsLoaded: '所有腳本已載入',
SearchPlaceholder: '搜尋腳本...',
ViewOnGreasyfork: '在Greasyfork查看',
errorMessage: '無法檢索腳本信息或該域沒有可用的腳本。',
Loading: '載入中...',
Scripts: '腳本'
},
'ja': {
Author: '著者',
Installs: 'インストール数',
DailyInstalls: '日次インストール数',
Created: '作成日',
Updated: '更新日',
Rating: '評価',
LoadingScripts: 'スクリプトを読み込んでいます...',
LoadMore: 'もっと読む',
AllScriptsLoaded: 'すべてのスクリプトが読み込まれました',
SearchPlaceholder: 'スクリプトを検索...',
ViewOnGreasyfork: 'Greasyforkで見る',
errorMessage: 'スクリプト情報の取得に失敗するか、またはこのドメインには利用可能なスクリプトがありません。',
Loading: '読み込み中...',
Scripts: 'スクリプト'
},
'vi': {
Author: 'Tác giả',
Installs: 'Số lượt cài đặt',
DailyInstalls: 'Cài đặt hàng ngày',
Created: 'Ngày tạo',
Updated: 'Ngày cập nhật',
Rating: 'Đánh giá',
LoadingScripts: 'Đang tải các tập lệnh...',
LoadMore: 'Tải thêm',
AllScriptsLoaded: 'Đã tải tất cả các tập lệnh',
SearchPlaceholder: 'Tìm kiếm tập lệnh...',
ViewOnGreasyfork: 'Xem trên Greasyfork',
errorMessage: 'Không thể truy xuất thông tin tập lệnh hoặc không có tập lệnh nào có sẵn cho miền này.',
Loading: 'Đang tải...',
Scripts: 'Tập lệnh'
}
}
// 返回翻译函数
return (id, lang = '') => {
const selectedLang = lang || userLang
return (strings[selectedLang] || strings.en)[id] || strings.en[id]
}
}());
(function () {
const domainParts = window.location.hostname.split('.').slice(-2)
const domain = domainParts.join('.')
const errorMessage = translate('errorMessage')
let neverLoadedScripts = true
let collapsed = true
let loadedPages = 0
function getScriptsInfo(domain, page = 1) {
var url = `https://greasyfork.org/scripts/by-site/${domain}?filter_locale=0&sort=updated&page=${page}`
GM_xmlhttpRequest({
method: 'GET',
url: url,
onload: (response) => {
// 解析结果
const parser = new DOMParser()
const doc = parser.parseFromString(response.responseText, 'text/html')
const scripts = doc.querySelector('#browse-script-list')?.querySelectorAll('[data-script-id]')
let scriptsInfo = []
if (!scripts) {
scriptsInfo = errorMessage
} else {
for (var i = 0; i < scripts.length; i++) {
scriptsInfo.push(parseScriptInfo(scripts[i]))
}
}
// 处理对象
const loadMoreButton = document.querySelector('.load-more')
console.log(doc.querySelector('.next_page'))
if (doc.querySelector('.next_page') == null || doc.querySelector('.next_page')?.getAttribute('aria-disabled') === 'true') {
loadedPages = 'max'
loadMoreButton.disabled = true
loadMoreButton.textContent = translate('AllScriptsLoaded')
} else {
loadMoreButton.disabled = false
loadMoreButton.textContent = translate('LoadMore')
}
// console.log(scriptsInfo);
document.querySelector('.wait-loading').style.display = 'none'
loadMoreButton.style.display = 'block'
appendScriptsInfo(scriptsInfo)
updateMatches()
loadedPages = typeof loadedPages === 'number' ? loadedPages + 1 : 0
// console.log(loadedPages)
},
onerror: () => {
console.log('Some error occurred!')
if (loadedPages === 0) {
appendScriptsInfo(scriptsInfo)
}
const scriptsInfo = errorMessage
document.querySelector('.wait-loading').style.display = 'none'
}
})
}
// 解析脚本信息
function parseScriptInfo(script) {
return {
id: script.getAttribute('data-script-id'),
name: script.getAttribute('data-script-name'),
author: script.querySelector('dd.script-list-author').textContent,
description: script.querySelector('.script-description').textContent,
version: script.getAttribute('data-script-version'),
url: 'https://greasyfork.org/scripts/' + script.getAttribute('data-script-id'),
createDate: script.getAttribute('data-script-created-date'),
updateDate: script.getAttribute('data-script-updated-date'),
installs: script.getAttribute('data-script-total-installs'),
dailyInstalls: script.getAttribute('data-script-daily-installs'),
ratingScore: script.getAttribute('data-script-rating-score')
}
}
// 插入脚本
function appendScriptsInfo(scriptsInfo) {
const infoList = document.querySelector('.info-list')
if (scriptsInfo === errorMessage) {
// infoList.innerHTML = errorMessage;
const loadMoreButton = document.querySelector('.load-more')
loadMoreButton.disabled = true
loadMoreButton.textContent = translate('AllScriptsLoaded')
loadMoreButton.innerHTML = errorMessage
} else {
for (var i = 0; i < scriptsInfo.length; i++) {
var script = scriptsInfo[i]
var listItem = document.createElement('li')
listItem.className = 'info-item'
var scriptContainer = document.createElement('div')
scriptContainer.className = 'script-container'
var nameElement = document.createElement('a')
nameElement.className = 'mscript-link'
nameElement.innerText = script.name
nameElement.href = script.url
nameElement.target = '_blank'
var descriptionElement = document.createElement('p')
descriptionElement.className = 'script-description'
descriptionElement.innerHTML = script.description
var detailsContainer = document.createElement('div')
detailsContainer.className = 'details-container'
// 创建一键安装按钮
var installButton = document.createElement('a')
installButton.className = 'install-button'
installButton.innerText = `Install ${script.version}`
installButton.href = `https://greasyfork.org/scripts/${script.id}/code/script.user.js`
const details = [
{ key: translate('Author'), value: script.author },
{ key: translate('Installs'), value: script.installs },
{ key: translate('DailyInstalls'), value: script.dailyInstalls },
{ key: translate('Created'), value: script.createDate },
{ key: translate('Updated'), value: script.updateDate },
{ key: translate('Rating'), value: script.ratingScore }
]
for (let i = 0; i < details.length; i++) {
const spanElement = document.createElement('span')
spanElement.className = 'script-details'
spanElement.innerText = `${details[i].key}:\n${details[i].value}`
detailsContainer.appendChild(spanElement)
}
scriptContainer.appendChild(nameElement)
scriptContainer.appendChild(descriptionElement)
scriptContainer.appendChild(detailsContainer)
scriptContainer.appendChild(installButton)
listItem.appendChild(scriptContainer)
listItem.scriptId = script.id
infoList.appendChild(listItem)
}
}
}
function setupUI() {
GM_addStyle(`
scrbutton.script-button {
position: fixed;
bottom: 20%;
right: -50px;
transform: translateY(50%);
padding: 20px;
font-size: 16px;
border: none;
border-radius: 4px;
background-color: #1e90ff;
color: #ffffff;
cursor: pointer;
transition: right 0.3s;
z-index: 9999999999999999;
}
div.info-container {
display: none;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 650px;
padding: 12px;
background-color: #ffffff;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
border-radius: 4px;
opacity: 0;
transition: opacity 0.3s;
z-index: 9999;
max-height: 80vh;
overflow-y: auto;
}
ul.info-list {
list-style: none;
margin: 0;
padding: 0;
}
li.info-item {
margin-bottom: 15px;
padding: 12px;
padding-bottom: 22px;
display: flex;
flex-direction: column;
border: 1px solid #1e90ff;
border-radius: 5px;
}
.div.script-container {
display: flex;
flex-direction: column;
}
a.mscript-link {
font-size: 18px !important;
font-weight: bold !important;
margin-bottom: 5px !important;
color: #1e90ff !important;
}
p.script-description {
color: black !important;
margin-top: 2px;
margin-bottom: 5px;
font-size: 16px;
}
div.details-container {
font-size: 15px;
font-weight: bold;
display: flex;
justify-content: space-between;
margin-bottom: 15px;
}
span.script-details {
font: !important;
color: black !important;
flex-grow: 1 !important;
text-align: center !important;
border: 1px solid #1e90ff !important;
border-radius: 5px !important;
margin: 4px !important;
}
div.table-header {
color: #1e90ff !important;
font-size: 25px;
font-weight: bold;
}
input.script-search-input {
width: 96% !important;
padding: 10px !important;
font-size: 18px !important;
border: 1px solid #1e90ff !important;
border-radius: 4px !important;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3) !important;
margin-bottom: 15px !important;
margin-top: 20px !important;
}
a.install-button {
font-size: 20px;
background-color: green;
color: white;
padding: 12px;
}
button.to-greasyfork {
position: absolute;
top: 12px;
right: 12px;
border-radius: 4px;
padding: 8px;
font-size: 16px;
border: none;
background-color: #1e90ff;
color: #ffffff;
cursor: pointer;
}
span.match-count {
background-color: #1e90ff;
font-size: 25px;
font-weight: bold;
color: white;
padding: 6px;
position: absolute;
right: 50%;
border-radius: 12px;
top: 10px;
}
div.wait-loading {
font-size: 20px;
font-weight: bold;
color: #1e90ff;
animation: blink 1s infinite;
}
@keyframes fadeInOut {
0% {
opacity: 0;
}
50% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@keyframes blink {
0%, 100% {
opacity: 0;
}
50% {
opacity: 1;
}
}
button.load-more {
border-radius: 4px;
padding: 8px;
font-size: 16px;
border: none;
background-color: #1e90ff;
color: #ffffff;
cursor: pointer;
position: relative;
bottom: 5px;
left: 50%;
transform: translateX(-50%);
}
button.load-more:disabled {
background-color: #cccccc;
cursor: not-allowed;
}
/* Mobile styles */
@media (max-width: 600px) {
scrbutton.script-button {
right: -30px;
padding: 8px;
font-size: 14px;
}
span.script-details {
font-size: 10px !important;
margin: 2px !important;
padding: 2px !important;
}
span.match-count {
font-size: 20px;
padding: 4px;
}
button.to-greasyfork {
padding: 6px;
font-size: 14px;
}
a.install-button {
font-size: 12px;
padding: 8px;
}
div.table-header {
font-size: 20px;
}
div.script-container {
padding: 10px;
}
div.info-container {
top: 10%;
left: 5%;
right: 5%;
transform: none;
width: calc(90% - 10px); /* 自适应宽度,保持左右边距 */
max-width: 100%; /* 确保不超出屏幕宽度 */
}
a.mscript-link {
font-size: 16px !important;
}
p.script-description {
font-size: 14px;
}
{
input.script-search-input {
width: 92% !important;
padding: 8px !important;
font-size: 16px !important;
}
span.match-count {
font-size: 20px;
padding: 4px;
}
button.load-more {
font-size: 14px;
padding: 6px;
}
}
`)
// 创建打开列表按钮
var button = document.createElement('scrbutton')
button.className = 'script-button'
button.innerText = translate('Scripts')
document.addEventListener('fullscreenchange', function () {
if (document.fullscreenElement) {
button.style.display = 'none'
} else {
button.style.display = 'block'
}
})
// 创建脚本容器
var infoContainer = document.createElement('div')
infoContainer.className = 'info-container'
// 创建搜索框
var searchInput = document.createElement('input')
searchInput.type = 'text'
searchInput.placeholder = translate('SearchPlaceholder')
searchInput.className = 'script-search-input'
// 创建指向greasyfork的链接
var toGreasyfork = document.createElement('button')
toGreasyfork.className = 'to-greasyfork'
toGreasyfork.innerText = translate('ViewOnGreasyfork')
// 创建计数器
var matchCount = document.createElement('span')
matchCount.className = 'match-count'
// 创建表头
var tableHeader = document.createElement('div')
tableHeader.className = 'table-header'
tableHeader.appendChild(document.createTextNode('Script Finder'))
tableHeader.appendChild(matchCount)
tableHeader.appendChild(searchInput)
tableHeader.appendChild(toGreasyfork)
// 创建脚本列表
var infoList = document.createElement('ul')
infoList.className = 'info-list'
// 创建等待加载
var waitLoading = document.createElement('div')
waitLoading.className = 'wait-loading'
waitLoading.innerText = translate('LoadingScripts')
// 创建加载更多
var loadMore = document.createElement('button')
loadMore.className = 'load-more'
loadMore.innerText = 'Load more'
loadMore.style.display = 'none'
infoList.appendChild(waitLoading)
infoList.appendChild(loadMore)
infoContainer.appendChild(tableHeader)
infoContainer.appendChild(infoList)
var timeout
button.addEventListener('mouseenter', function () {
clearTimeout(timeout)
button.style.right = '10px'
})
button.addEventListener('mouseleave', function () {
timeout = setTimeout(function () {
button.style.right = '-50px'
}, 500)
})
button.addEventListener('click', function (event) {
event.stopPropagation()
if (collapsed) {
infoContainer.style.display = 'block'
infoContainer.style.opacity = 1
collapsed = false
}
else {
infoContainer.style.display = 'none'
infoContainer.style.opacity = 0
collapsed = true
}
if (neverLoadedScripts) {
getScriptsInfo(domain, 1)
neverLoadedScripts = false
}
})
infoContainer.addEventListener('click', function (event) {
event.stopPropagation()
})
searchInput.addEventListener('input', () => {
searchScript()
updateMatches()
})
toGreasyfork.addEventListener('click', function () {
window.open(`https://greasyfork.org/scripts/by-site/${domain}?q=${searchInput.value}&filter_locale=0&sort=updated`)
})
loadMore.addEventListener('click', () => {
if (loadedPages === 'max') {
return
}
const loadMoreButton = document.querySelector('.load-more')
loadMoreButton.disabled = true
loadMoreButton.textContent = translate('Loading')
document.querySelector('.wait-loading').style.display = 'block'
getScriptsInfo(domain, loadedPages + 1)
})
document.body.addEventListener('click', function () {
clearTimeout(timeout)
collapsed = true
button.style.right = '-50px'
infoContainer.style.opacity = 0
infoContainer.style.display = 'none'
})
document.body.appendChild(button)
document.body.appendChild(infoContainer)
infoContainer.addEventListener('change', () => {
updateMatches()
})
updateMatches()
}
function searchScript() {
const searchWord = document.querySelector('.script-search-input').value.toLowerCase() // 将要匹配的文本转换为小写
const scriptList = document.querySelectorAll('.info-item')
for (let i = 0; i < scriptList.length; i++) {
const scriptText = scriptList[i].innerText.toLowerCase() // 将检索的文本转换为小写
if (scriptText.includes(searchWord)) {
scriptList[i].style.display = 'block'
} else {
scriptList[i].style.display = 'none'
}
}
}
function updateMatches() {
const matchCount = document.querySelectorAll('.info-item:not([style*="display: none"])').length
const allCount = document.querySelectorAll('.info-item').length
document.querySelector('.match-count').innerText = matchCount === allCount ? matchCount : `${matchCount}/${allCount}`
}
function main() {
if (window.self !== window.top) {
// 在iframe中执行时,直接退出
return
}
setupUI()
}
main()
})()