mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-17 02:34:38 -05:00
remove cache from search
This commit is contained in:
parent
18d303abd9
commit
8721ad924d
1 changed files with 37 additions and 28 deletions
|
@ -68,6 +68,39 @@ summary:hover{
|
|||
.info > div {
|
||||
font-family:Ubuntu, sans-serif;
|
||||
}
|
||||
#fetch-spinner {
|
||||
position: fixed;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
z-index: 9999;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
border-top: 2px solid #fff;
|
||||
border-right: 2px solid #fff;
|
||||
animation: spin 0.8s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
#fetch-text {
|
||||
position: fixed;
|
||||
top: 10px;
|
||||
right: 40px;
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
z-index: 9999;
|
||||
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.app{
|
||||
/* background-image:url("/css/head.svg"); */
|
||||
|
@ -178,6 +211,8 @@ border:solid;
|
|||
.tabs a.tab:hover {
|
||||
color: #3cb4fa;
|
||||
}
|
||||
|
||||
|
||||
.tabs a.tab:after {
|
||||
transition: all 0.3s cubic-bezier(1, 0, 0, 1);
|
||||
will-change: transform, box-shadow, opacity;
|
||||
|
@ -572,32 +607,6 @@ function toggleAudio() {
|
|||
}
|
||||
|
||||
|
||||
const urls = document.querySelectorAll('a[href*="/watch?v="]'); // get all links with "/watch?v=" in href attribute
|
||||
|
||||
urls.forEach(link => {
|
||||
const url = new URL(link.href);
|
||||
|
||||
if (url.host !== 'www.youtube.com' && url.host !== 'youtube.com') {
|
||||
console.log(`Fetching ${url.origin}`);
|
||||
|
||||
fetch(url.href)
|
||||
.then(response => {
|
||||
if (response.status === 500) {
|
||||
// do nothing
|
||||
}
|
||||
console.log(`Fetched ${url.origin}`);
|
||||
// Do something with the response
|
||||
})
|
||||
.catch(error => {
|
||||
// Ignore network errors
|
||||
if (!(error instanceof TypeError && error.message.includes('Failed to fetch'))) {
|
||||
console.error(`Error fetching ${url.origin}: ${error}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
if (audioToggled === null || audioToggled === undefined) {
|
||||
audioToggled = true;
|
||||
|
|
Loading…
Reference in a new issue