'); } return html; }); }).catch(function () { return null; }); var hwerPre = document.createElement('link'); hwerPre.rel = 'preload'; hwerPre.as = 'fetch'; hwerPre.href = hwerUrl; hwerPre.crossOrigin = 'anonymous'; document.head.appendChild(hwerPre); } // Closeburn stays on the clean host (like High Wycombe). Do not // location.replace onto /closeburn/website/ — that folder is only the // Hosting file path. The shared custom-domain prefetch below paints it. // Chesterfield homepage: the shared shell is what Firebase serves for // "/". Swap in the real page so Google sees the title, the opening // sentence, and the game links in the main document. var kbMirrorHome = ''; var kbMirrorName = ''; var kbMirrorAnyPath = false; if (h === 'chesterfieldescaperooms.co.uk') { kbMirrorHome = '/chesterfieldescapero/website/'; kbMirrorName = 'Chesterfield Escape Rooms'; } else if (h === 'coventryescaperooms.co.uk') { kbMirrorHome = '/coventryscaperooms/website/'; kbMirrorName = 'Coventry Escape Rooms'; } else if (h === 'aylesburyescaperooms.com' || h === 'aylesburyescaperooms.co.uk') { kbMirrorHome = '/aylesburyescaperooms/website/'; kbMirrorName = 'Aylesbury Escape Rooms'; } else if (h === 'sudburyescaperooms.uk') { kbMirrorHome = '/sudburyescaperooms/website/'; kbMirrorName = 'Sudbury Escape Rooms'; } else if (h === 'chelmsfordescaperooms.co.uk') { kbMirrorHome = '/chelmsfordescaperooms/website/'; kbMirrorName = 'Chelmsford Escape Rooms'; kbMirrorAnyPath = true; } else if (h === 'maldonescaperooms.co.uk') { kbMirrorHome = '/maldonescaperooms/website/'; kbMirrorName = 'Maldon Escape Rooms'; kbMirrorAnyPath = true; } else if (h === 'bishopsstortfordescaperooms.co.uk') { kbMirrorHome = '/bishopsstortfordescaperooms/website/'; kbMirrorName = "Bishop's Stortford Escape Rooms"; kbMirrorAnyPath = true; } var kbMirrorIsHome = path === '/' || path === '' || path === '/index.html'; if (kbMirrorHome && (kbMirrorIsHome || kbMirrorAnyPath)) { var kbMirrorFile = kbMirrorIsHome ? 'index.html' : String(path || '').replace(/^\/+/, '').replace(/\/+$/, '') + '/index.html'; fetch(kbMirrorHome + kbMirrorFile, { credentials: 'omit' }) .then(function (r) { return r.ok ? r.text() : ''; }) .then(function (html) { if (!html || html.length < 8000 || html.indexOf(kbMirrorName) < 0) return; if (/kb-boot-title/i.test(html)) return; html = html.replace(/]*>/i, ''); var homePrefix = kbMirrorHome.replace(/\/+$/, ''); var escaped = homePrefix.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); html = html.replace(new RegExp('href=(["\'])' + escaped + '/([^"\']*)\\1', 'gi'), function (full, q, rest) { if (/^(wp-content|wp-includes|wp-json)(\/|$)/i.test(rest)) return full; if (/\.(css|js|mjs|map|png|jpe?g|webp|gif|svg|ico|woff2?)(\?|#|$)/i.test(rest)) return full; var pth = String(rest || '').replace(/index\.html$/i, ''); if (!pth || pth === '/') return 'href=' + q + (kbMirrorAnyPath ? '/' : homePrefix + '/') + q; if (pth.charAt(0) === '#' || pth.charAt(0) === '?') return 'href=' + q + homePrefix + '/' + pth + q; if (pth.charAt(0) !== '/') pth = '/' + pth; if (pth.slice(-1) !== '/' && pth.indexOf('#') < 0 && pth.indexOf('?') < 0) pth += '/'; return 'href=' + q + pth + q; }); if (kbMirrorAnyPath) { html = html.replace(/[\s\S]*?(?=]*\bkb:website-cookie-settings\b[^>]*>[\s\S]*?<\/button>/gi, ''); if (!/id=["']kb-desktop-panes["']/.test(html)) { html = html.replace(/<\/head>/i, ''); } } document.open(); document.write(html); document.close(); }) .catch(function () {}); } } catch (e) {} })();