コミットを比較

...

1 コミット

作成者 SHA1 メッセージ 日付
守矢諏訪子 75e711b334 まだ動いていない 2023-06-06 13:24:05 +09:00
3個のファイルの変更42行の追加1行の削除

バイナリ
src/assets/images/amazon-icon.png ノーマルファイル

バイナリファイルは表示されません。

変更後

幅:  |  高さ:  |  サイズ: 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": {