change to cors(last)

This commit is contained in:
cutls 2021-02-16 23:27:52 +09:00
parent 3f844bfe60
commit 7f79f1773d

View File

@ -1108,7 +1108,12 @@ input.addEventListener(
if (prev_val != new_val) { if (prev_val != new_val) {
if (new_val.length > 3) { if (new_val.length > 3) {
var start = 'https://www.fediversesearch.com/search/?keyword=' + new_val var start = 'https://www.fediversesearch.com/search/?keyword=' + new_val
fetch(start) fetch(start, {
method: 'GET',
headers: {
'content-type': 'application/json',
}
})
.then(function (response) { .then(function (response) {
if (!response.ok) { if (!response.ok) {
response.text().then(function (text) { response.text().then(function (text) {
@ -1129,7 +1134,7 @@ input.addEventListener(
var url = json.data[key] var url = json.data[key]
urls = urls =
urls + urls +
`<a onclick="login('${url.url}')" class="pointer" title="${url.uri}">${escapeHTML(url.title ? url.title : url.uri)}</a>, ` `<a onclick="login('${url.uri}')" class="pointer" title="${url.uri}">${escapeHTML(url.title ? url.title : url.uri)}</a>, `
}) })
$('#ins-suggest').html(urls) $('#ins-suggest').html(urls)
} else { } else {