まだ動いていない
このコミットが含まれているのは:
コミット
75e711b334
バイナリファイルは表示されません。
変更後 幅: | 高さ: | サイズ: 42 KiB |
|
@ -56,6 +56,7 @@ function redirect(url, type, initiator, forceRedirection) {
|
|||
let randomInstance
|
||||
let frontend
|
||||
for (const service in config.services) {
|
||||
console.log(service, options[service])
|
||||
if (!forceRedirection && !options[service].enabled) continue
|
||||
|
||||
frontend = options[service].frontend
|
||||
|
@ -552,6 +553,20 @@ function redirect(url, type, initiator, forceRedirection) {
|
|||
if (url.hostname == "i.pinimg.com") return `${randomInstance}/image_proxy.php?url=${url.href}`
|
||||
return randomInstance
|
||||
}
|
||||
case "simpleamazon": {
|
||||
if (url.hostname == "amazon.co.jp" || url.hostname == "www.amazon.co.jp") {
|
||||
//const regex = url.hostname.match(/\.\s/)
|
||||
//console.log(regex)
|
||||
if (url.pathname.startsWith('/s')) {
|
||||
if (url.search) {
|
||||
let query = url.search.split("?")[1].split("&")
|
||||
query.forEach(x => { if (x.startsWith("k=")) query = x.split("=")[1] })
|
||||
return `${randomInstance}/s?k=${query}&page=1&s=&tld=co.jp`
|
||||
}
|
||||
return randomInstance
|
||||
}
|
||||
}
|
||||
}
|
||||
case "spliti": {
|
||||
if (url.hostname == "news.mixi.jp") {
|
||||
if (url.search) {
|
||||
|
@ -571,7 +586,6 @@ function redirect(url, type, initiator, forceRedirection) {
|
|||
if (url.hostname == "pixiv.net" || url.hostname == "www.pixiv.net") {
|
||||
let path = url.pathname
|
||||
if (url.pathname.startsWith('/en')) path = path.splice(3)
|
||||
console.log(path)
|
||||
if (path.startsWith('/users')) {
|
||||
const illustid = /\/(\d+)\/?$/.exec(url.pathname)[1]
|
||||
if (path.includes('/illusts')) return `${randomInstance}/users/illusts/?id=${illustid}`
|
||||
|
@ -713,6 +727,7 @@ const defaultInstances = {
|
|||
'searxng': ['https://search.bus-hit.me'],
|
||||
'rimgo': ['https://rimgo.vern.cc'],
|
||||
'librarian': ['https://odysee.owacon.moe'],
|
||||
'simpleamazon': ['https://az.vern.cc'],
|
||||
'beatbump': ['https://beatbump.ml'],
|
||||
'hyperpipe': ['https://hyperpipe.surge.sh'],
|
||||
'facil': [' https://facilmap.org '],
|
||||
|
|
|
@ -154,6 +154,32 @@
|
|||
"embeddable": true,
|
||||
"url": "https://news.mixi.jp"
|
||||
},
|
||||
"amazon": {
|
||||
"frontends": {
|
||||
"simpleamazon": {
|
||||
"name": "SimpleAmazon",
|
||||
"embeddable": false,
|
||||
"instanceList": true,
|
||||
"url": "https://codeberg.org/SimpleWeb/SimpleAmazon",
|
||||
"localhost": true
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
"^https?:\\/{2}(www\\.)?amazon\\.com\\/s(\\/|$)",
|
||||
"^https?:\\/{2}(www\\.)?amazon\\.co.jp\\/s(\\/|$)"
|
||||
],
|
||||
"name": "Amazon",
|
||||
"options": {
|
||||
"enabled": false,
|
||||
"redirectType": "main_frame",
|
||||
"unsupportedUrls": "bypass",
|
||||
"frontend": "simpleamazon",
|
||||
"instance": "public"
|
||||
},
|
||||
"imageType": "png",
|
||||
"embeddable": true,
|
||||
"url": "https://amazon.co.jp"
|
||||
},
|
||||
"pixiv": {
|
||||
"frontends": {
|
||||
"vixip": {
|
||||
|
|
新しいイシューから参照