MCPcopy Create free account
hub / github.com/GamerHack/GamerHack.github.io / onpopstate

Function onpopstate

g2all/700/psfree.js:201–225  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

199 let resolves = [];
200
201 function onpopstate(event) {
202 const no_pop = pop === null;
203 const idx = no_pop ? 0 : 1;
204
205 log(`pop ${idx} came`);
206 if (blurs[idx] === 0) {
207 const r = resolves[idx][1];
208 r(new DieError(`blurs before pop ${idx} came: ${blurs[idx]}`));
209 }
210
211 if (no_pop) {
212 pop_promise2 = new Promise((resolve, reject) => {
213 resolves.push([resolve, reject]);
214 addEventListener("popstate", onpopstate, { once: true });
215 history.back();
216 });
217 }
218
219 if (no_pop) {
220 pop = event;
221 } else {
222 pop2 = event;
223 }
224 resolves[idx][0]();
225 }
226
227 const pop_promise = new Promise((resolve, reject) => {
228 resolves.push([resolve, reject]);

Callers

nothing calls this directly

Calls 1

logFunction · 0.90

Tested by

no test coverage detected