Skip to content

Commit 2f4aa56

Browse files
committed
fix: do not associate cache values with time
1 parent 5b27927 commit 2f4aa56

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

views/assets/js/common-1735118314.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ const getDomain = () =>
2121
goFrame = (url) => {
2222
localStorage.setItem('{{hu-lts}}-frame-url', url);
2323
if (location.pathname !== '{{route}}{{/s}}')
24-
location.href = '{{route}}{{/s}}';
24+
location.href =
25+
'{{route}}{{/s}}' +
26+
'?cache=' +
27+
crypto.getRandomValues(new Uint32Array(1))[0];
2528
else document.getElementById('frame').src = url;
2629
},
2730
/* Used to set functions for the goProx object at the bottom.
@@ -910,8 +913,8 @@ const preparePage = async () => {
910913
a = document.createElement('a'),
911914
img = document.createElement('img'),
912915
title = document.createElement('h3');
913-
desc = document.createElement('p'),
914-
credits = document.createElement('p');
916+
((desc = document.createElement('p')),
917+
(credits = document.createElement('p')));
915918

916919
a.href = '#';
917920
img.src = `{{route}}{{/assets/img/}}${dir}/` + item.img;
@@ -928,7 +931,6 @@ const preparePage = async () => {
928931
a.appendChild(img);
929932
a.appendChild(title);
930933
a.appendChild(desc);
931-
932934

933935
// Which function is used for the click event is determined by
934936
// the corresponding location/index in the dirnames object.
@@ -942,11 +944,11 @@ const preparePage = async () => {
942944
item.core +
943945
'&rom=' +
944946
item.rom
945-
),
947+
),
946948
// par-nav
947949
item.custom && goProx[item.custom]
948950
? () => goProx[item.custom]('stealth')
949-
: () => {},
951+
: () => {},
950952
// h5-nav
951953
item.custom && goProx[item.custom]
952954
? () => goProx[item.custom]('stealth')

views/assets/js/loader.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,12 @@
5656
console.clear();
5757
if (response.status === 200) {
5858
let capturedLink = new URL(destination),
59-
timestamp = Date.now();
59+
cacheVal = crypto.getRandomValues(new Uint32Array(1))[0];
6060
capturedLink.search = capturedLink.search
61-
? capturedLink.search + '&cache=' + timestamp
62-
: '?cache=' + timestamp;
61+
? capturedLink.search + '&cache=' + cacheVal
62+
: '?cache=' + cacheVal;
6363
history.pushState({}, '', capturedLink);
64-
}
65-
else return location.assign(new URL(destination, location));
64+
} else return location.assign(new URL(destination, location));
6665
}
6766
response.blob().then((blob) => {
6867
new Response(

0 commit comments

Comments
 (0)