Skip to content
This repository was archived by the owner on Mar 26, 2022. It is now read-only.

Commit d3badaf

Browse files
authored
Update embed.js
1 parent b677587 commit d3badaf

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

embed.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,23 +116,20 @@ async function ifCached_test() {
116116

117117
// Will include credentials so please use a sandbox domain or my postMessage API
118118
async function ifCached(url, purge = false) {
119-
var state = true;
120119
var controller = new AbortController();
121120
var signal = controller.signal;
122121
var timeout = await setTimeout(_ => { // Stop request after max
123122
controller.abort();
124-
state = false;
125123
}, max);
126124
try {
127125
let options = {mode: "no-cors", credentials: "include", signal};
128126
if(purge) options.cache = "reload";
129127
await fetch(url, options);
130128
} catch (err) {
131-
// Website blocked by client
132129
return false
133130
}
134131
clearTimeout(timeout);
135-
return state;
132+
return true;
136133
}
137134

138135
function WindowEvent(check = false) {

0 commit comments

Comments
 (0)