forked from sent/waves
❕❕❕❕
This commit is contained in:
parent
b1047929f9
commit
9479504cc9
|
@ -8,45 +8,24 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||||
const iframe = document.getElementById('cool-iframe');
|
const iframe = document.getElementById('cool-iframe');
|
||||||
const erudaLoadingScreen = document.getElementById('erudaLoadingScreen');
|
const erudaLoadingScreen = document.getElementById('erudaLoadingScreen');
|
||||||
if (!refreshIcon || !fullscreenIcon || !backIcon || !forwardIcon || !iframe) return;
|
if (!refreshIcon || !fullscreenIcon || !backIcon || !forwardIcon || !iframe) return;
|
||||||
let loadingFallbackTimeout;
|
|
||||||
let loadingHidden = false;
|
let loadingHidden = false;
|
||||||
|
|
||||||
function showLoadingScreen(withToast = true, showEruda = false) {
|
function showLoadingScreen(withToast = true, showEruda = false) {
|
||||||
loadingHidden = false;
|
loadingHidden = false;
|
||||||
const loadingScreen = document.querySelector(".loading-screen");
|
NProgress.start();
|
||||||
if (!loadingScreen) return;
|
|
||||||
if (erudaLoadingScreen) {
|
|
||||||
erudaLoadingScreen.style.display = showEruda ? 'block' : 'none';
|
|
||||||
}
|
|
||||||
typeof NProgress !== 'undefined' && NProgress.start();
|
|
||||||
loadingScreen.style.display = 'flex';
|
|
||||||
loadingScreen.style.transition = '';
|
|
||||||
setTimeout(() => {
|
|
||||||
loadingScreen.style.transition = 'opacity 0.3s ease';
|
|
||||||
loadingScreen.style.opacity = 1;
|
|
||||||
}, 10);
|
|
||||||
const loadingText = loadingScreen.querySelector(".loading-text");
|
|
||||||
if (loadingText) {
|
|
||||||
loadingText.innerHTML = "We're getting your content ready, please wait...";
|
|
||||||
}
|
|
||||||
if (withToast) {
|
if (withToast) {
|
||||||
showToast('Consider joining our <a href="https://discord.gg/dJvdkPRheV" target="_blank" class="hover-link">Discord</a> <3');
|
showToast(
|
||||||
|
'Consider joining our <a href="https://discord.gg/dJvdkPRheV" target="_blank" class="hover-link">Discord</a> <3',
|
||||||
|
'success',
|
||||||
|
'heart'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
loadingFallbackTimeout = setTimeout(() => { hideLoadingScreen(); }, 10000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideLoadingScreen() {
|
function hideLoadingScreen() {
|
||||||
if (loadingHidden) return;
|
if (loadingHidden) return;
|
||||||
loadingHidden = true;
|
loadingHidden = true;
|
||||||
const loadingScreen = document.querySelector(".loading-screen");
|
NProgress.done();
|
||||||
if (!loadingScreen) return;
|
|
||||||
typeof NProgress !== 'undefined' && NProgress.done();
|
|
||||||
loadingScreen.style.transition = 'opacity 0.3s ease';
|
|
||||||
loadingScreen.style.opacity = 0;
|
|
||||||
clearTimeout(loadingFallbackTimeout);
|
|
||||||
setTimeout(() => {
|
|
||||||
loadingScreen.style.display = 'none';
|
|
||||||
}, 500);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshIcon.addEventListener('click', () => {
|
refreshIcon.addEventListener('click', () => {
|
||||||
|
@ -58,16 +37,14 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||||
}
|
}
|
||||||
iframe.contentWindow.location.reload(true);
|
iframe.contentWindow.location.reload(true);
|
||||||
}
|
}
|
||||||
setTimeout(() => { refreshIcon.classList.remove('spin'); }, 300);
|
setTimeout(() => refreshIcon.classList.remove('spin'), 300);
|
||||||
});
|
});
|
||||||
|
|
||||||
fullscreenIcon.addEventListener('click', () => {
|
fullscreenIcon.addEventListener('click', () => {
|
||||||
if (iframe.tagName === 'IFRAME') {
|
|
||||||
if (iframe.requestFullscreen) iframe.requestFullscreen();
|
if (iframe.requestFullscreen) iframe.requestFullscreen();
|
||||||
else if (iframe.mozRequestFullScreen) iframe.mozRequestFullScreen();
|
else if (iframe.mozRequestFullScreen) iframe.mozRequestFullScreen();
|
||||||
else if (iframe.webkitRequestFullscreen) iframe.webkitRequestFullscreen();
|
else if (iframe.webkitRequestFullscreen) iframe.webkitRequestFullscreen();
|
||||||
else if (iframe.msRequestFullscreen) iframe.msRequestFullscreen();
|
else if (iframe.msRequestFullscreen) iframe.msRequestFullscreen();
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
backIcon.addEventListener('click', () => {
|
backIcon.addEventListener('click', () => {
|
||||||
|
@ -93,9 +70,11 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||||
function normalizeUrl(urlStr) {
|
function normalizeUrl(urlStr) {
|
||||||
try {
|
try {
|
||||||
const url = new URL(urlStr);
|
const url = new URL(urlStr);
|
||||||
url.searchParams.delete("ia");
|
url.searchParams.delete('ia');
|
||||||
return url.toString();
|
return url.toString();
|
||||||
} catch (e) { return urlStr; }
|
} catch (e) {
|
||||||
|
return urlStr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function addToHistory(url) {
|
function addToHistory(url) {
|
||||||
|
@ -109,24 +88,28 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateNavButtons() {
|
function updateNavButtons() {
|
||||||
backIcon.disabled = (currentIndex <= 0);
|
backIcon.disabled = currentIndex <= 0;
|
||||||
forwardIcon.disabled = (currentIndex >= historyStack.length - 1);
|
forwardIcon.disabled = currentIndex >= historyStack.length - 1;
|
||||||
backIcon.classList.toggle('disabled', currentIndex <= 0);
|
backIcon.classList.toggle('disabled', currentIndex <= 0);
|
||||||
forwardIcon.classList.toggle('disabled', currentIndex >= historyStack.length - 1);
|
forwardIcon.classList.toggle('disabled', currentIndex >= historyStack.length - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateDecodedSearchInput() {
|
function updateDecodedSearchInput() {
|
||||||
const searchInput2 = document.getElementById('searchInputt');
|
const searchInput2 = document.getElementById('searchInputt');
|
||||||
let url = "";
|
if (!searchInput2) return;
|
||||||
if (searchInput2) {
|
let url = '';
|
||||||
if (currentIndex >= 0 && historyStack[currentIndex]) url = historyStack[currentIndex];
|
if (currentIndex >= 0 && historyStack[currentIndex]) {
|
||||||
else if (iframe.src) url = iframe.src;
|
url = historyStack[currentIndex];
|
||||||
|
} else if (iframe.src) {
|
||||||
|
url = iframe.src;
|
||||||
|
}
|
||||||
searchInput2.value = decodeUrl(url);
|
searchInput2.value = decodeUrl(url);
|
||||||
const lockIcon = document.getElementById('lockIcon');
|
const lockIcon = document.getElementById('lockIcon');
|
||||||
if (lockIcon) {
|
if (lockIcon) {
|
||||||
lockIcon.className = decodeUrl(url).startsWith("https://") ? "fa-regular fa-lock" : "fa-regular fa-lock-open";
|
lockIcon.className = decodeUrl(url).startsWith('https://') ?
|
||||||
lockIcon.style.color = "";
|
'fa-regular fa-lock' :
|
||||||
}
|
'fa-regular fa-lock-open';
|
||||||
|
lockIcon.style.color = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,7 +117,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||||
try {
|
try {
|
||||||
hideLoadingScreen();
|
hideLoadingScreen();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error during iframe load:", error);
|
console.error('Error during iframe load:', error);
|
||||||
hideLoadingScreen();
|
hideLoadingScreen();
|
||||||
} finally {
|
} finally {
|
||||||
if (erudaLoadingScreen) erudaLoadingScreen.style.display = 'none';
|
if (erudaLoadingScreen) erudaLoadingScreen.style.display = 'none';
|
||||||
|
@ -146,41 +129,57 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||||
hideLoadingScreen();
|
hideLoadingScreen();
|
||||||
});
|
});
|
||||||
|
|
||||||
const navBar = document.querySelector(".navbar");
|
iframe.addEventListener('loadstart', () => {
|
||||||
const topBar = document.querySelector(".topbar");
|
if (navbarToggle && navbarToggle.checked && navBar) {
|
||||||
const searchInput1 = document.getElementById("searchInput");
|
navBar.style.display = 'block';
|
||||||
const searchInput2 = document.getElementById("searchInputt");
|
}
|
||||||
const movies = document.getElementById("movies");
|
showLoadingScreen(false, false);
|
||||||
const ai = document.getElementById("ai");
|
});
|
||||||
const navbarToggle = document.getElementById("navbar-toggle");
|
|
||||||
|
const navBar = document.querySelector('.navbar');
|
||||||
|
const topBar = document.querySelector('.topbar');
|
||||||
|
const searchInput1 = document.getElementById('searchInput');
|
||||||
|
const searchInput2 = document.getElementById('searchInputt');
|
||||||
|
const movies = document.getElementById('movies');
|
||||||
|
const ai = document.getElementById('ai');
|
||||||
|
const navbarToggle = document.getElementById('navbar-toggle');
|
||||||
|
|
||||||
if (navbarToggle && navBar) {
|
if (navbarToggle && navBar) {
|
||||||
const savedNavbarState = localStorage.getItem('navbarToggled');
|
const savedNavbarState = localStorage.getItem('navbarToggled');
|
||||||
navbarToggle.checked = savedNavbarState === null ? true : savedNavbarState === 'true';
|
navbarToggle.checked = savedNavbarState === null ? true : savedNavbarState === 'true';
|
||||||
navBar.style.display = (iframe.style.display === "block" && navbarToggle.checked) ? "block" : "none";
|
navBar.style.display =
|
||||||
navbarToggle.addEventListener("change", () => {
|
iframe.style.display === 'block' && navbarToggle.checked ? 'block' : 'none';
|
||||||
|
navbarToggle.addEventListener('change', () => {
|
||||||
localStorage.setItem('navbarToggled', navbarToggle.checked);
|
localStorage.setItem('navbarToggled', navbarToggle.checked);
|
||||||
navBar.style.display = (iframe.style.display === "block" && navbarToggle.checked) ? "block" : "none";
|
navBar.style.display =
|
||||||
|
iframe.style.display === 'block' && navbarToggle.checked ? 'block' : 'none';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
iframe.style.display = "none";
|
iframe.style.display = 'none';
|
||||||
window.addEventListener('load', hideLoadingScreen);
|
window.addEventListener('load', hideLoadingScreen);
|
||||||
|
|
||||||
[searchInput1, searchInput2].forEach(input => {
|
[searchInput1, searchInput2].forEach(input => {
|
||||||
if (input) {
|
if (input) {
|
||||||
input.addEventListener("keyup", (e) => {
|
input.addEventListener('keyup', e => {
|
||||||
if (e.key === "Enter") handleSearch(input.value);
|
if (e.key === 'Enter') handleSearch(input.value);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
movies && movies.addEventListener("click", (e) => { e.preventDefault(); handleSearch("https://movies.usewaves.site/"); });
|
if (movies) movies.addEventListener('click', e => {
|
||||||
ai && ai.addEventListener("click", (e) => { e.preventDefault(); handleSearch("https://ai.usewaves.site/"); });
|
e.preventDefault();
|
||||||
|
handleSearch('https://movies.usewaves.site/');
|
||||||
|
});
|
||||||
|
if (ai) ai.addEventListener('click', e => {
|
||||||
|
e.preventDefault();
|
||||||
|
handleSearch('https://ai.usewaves.site/');
|
||||||
|
});
|
||||||
|
|
||||||
function clearBackground() {
|
function clearBackground() {
|
||||||
const preserved = [
|
const preserved = [
|
||||||
document.querySelector(".navbar"),
|
document.querySelector('.navbar'),
|
||||||
document.getElementById("cool-iframe"),
|
document.getElementById('cool-iframe'),
|
||||||
document.querySelector(".loading-screen"),
|
document.querySelector('.loading-screen'),
|
||||||
erudaLoadingScreen
|
erudaLoadingScreen
|
||||||
];
|
];
|
||||||
Array.from(document.body.children).forEach(child => {
|
Array.from(document.body.children).forEach(child => {
|
||||||
|
@ -190,49 +189,45 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
|
||||||
async function handleSearch(query) {
|
async function handleSearch(query) {
|
||||||
clearBackground();
|
clearBackground();
|
||||||
const searchURL = generateSearchUrl(query);
|
|
||||||
if (searchInput2) {
|
let searchURL;
|
||||||
searchInput2.value = searchURL;
|
if (
|
||||||
|
query.startsWith('/assets/g/') ||
|
||||||
|
query.startsWith(window.location.origin + '/assets/g/')
|
||||||
|
) {
|
||||||
|
searchURL = query;
|
||||||
|
} else {
|
||||||
|
searchURL = generateSearchUrl(query);
|
||||||
}
|
}
|
||||||
preloadResources(searchURL);
|
|
||||||
showLoadingScreen(true, false);
|
if (searchInput2) searchInput2.value = searchURL;
|
||||||
iframe.style.display = "block";
|
|
||||||
if (topBar) {
|
|
||||||
topBar.style.display = "none";
|
|
||||||
}
|
|
||||||
backIcon.disabled = true;
|
|
||||||
forwardIcon.disabled = true;
|
|
||||||
try {
|
|
||||||
iframe.src = await getUrl(searchURL);
|
|
||||||
} catch (error) {}
|
|
||||||
historyStack.length = 0;
|
historyStack.length = 0;
|
||||||
currentIndex = -1;
|
currentIndex = -1;
|
||||||
|
showLoadingScreen(true, false);
|
||||||
|
iframe.style.display = 'block';
|
||||||
|
if (topBar) topBar.style.display = 'none';
|
||||||
|
backIcon.disabled = forwardIcon.disabled = true;
|
||||||
|
|
||||||
|
let finalUrl;
|
||||||
|
try {
|
||||||
|
const u = new URL(searchURL, window.location.origin);
|
||||||
|
if (u.origin === window.location.origin && u.pathname.startsWith('/assets/g/')) {
|
||||||
|
finalUrl = u.href;
|
||||||
|
} else {
|
||||||
|
finalUrl = await getUrl(searchURL);
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Error parsing URL, proxying by default:', err);
|
||||||
|
finalUrl = await getUrl(searchURL);
|
||||||
|
}
|
||||||
|
|
||||||
|
iframe.src = finalUrl;
|
||||||
iframe.onload = () => {
|
iframe.onload = () => {
|
||||||
hideLoadingScreen();
|
hideLoadingScreen();
|
||||||
if (navbarToggle && navbarToggle.checked && navBar) {
|
if (navbarToggle && navbarToggle.checked && navBar) navBar.style.display = 'block';
|
||||||
navBar.style.display = "block";
|
|
||||||
}
|
|
||||||
generateSubject();
|
generateSubject();
|
||||||
updateDecodedSearchInput();
|
updateDecodedSearchInput();
|
||||||
try {
|
|
||||||
if (iframe.contentDocument && !iframe.contentDocument.getElementById('uv-postmessage-hook')) {
|
|
||||||
const script = iframe.contentDocument.createElement('script');
|
|
||||||
script.id = 'uv-postmessage-hook';
|
|
||||||
script.textContent = `(function(){
|
|
||||||
const origPush=history.pushState;
|
|
||||||
const origReplace=history.replaceState;
|
|
||||||
function notify(){
|
|
||||||
window.parent.postMessage({type:'uv-url-change',url:location.href},'*');
|
|
||||||
}
|
|
||||||
history.pushState=function(){origPush.apply(history,arguments);notify();};
|
|
||||||
history.replaceState=function(){origReplace.apply(history,arguments);notify();};
|
|
||||||
window.addEventListener('popstate',notify);
|
|
||||||
window.addEventListener('hashchange',notify);
|
|
||||||
notify();
|
|
||||||
})();`;
|
|
||||||
iframe.contentDocument.head.appendChild(script);
|
|
||||||
}
|
|
||||||
} catch (e) {}
|
|
||||||
};
|
};
|
||||||
iframe.onerror = () => {
|
iframe.onerror = () => {
|
||||||
console.error('Failed to load content.');
|
console.error('Failed to load content.');
|
||||||
|
@ -244,19 +239,18 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
|
||||||
function generateSearchUrl(query) {
|
function generateSearchUrl(query) {
|
||||||
try {
|
try {
|
||||||
const url = new URL(query);
|
return new URL(query).toString();
|
||||||
return url.toString();
|
|
||||||
} catch {
|
} catch {
|
||||||
try {
|
try {
|
||||||
const url = new URL(`https://${query}`);
|
const u = new URL(`https://${query}`);
|
||||||
if (url.hostname.includes(".")) return url.toString();
|
if (u.hostname.includes('.')) return u.toString();
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
return `https://duckduckgo.com/?q=${encodeURIComponent(query)}`;
|
return `https://search.brave.com/search?q=${encodeURIComponent(query)}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function showToast(message, type = "success", iconType = "check") {
|
function showToast(message, type = 'success', iconType = 'check') {
|
||||||
const toast = document.createElement("div");
|
const toast = document.createElement('div');
|
||||||
toast.className = `toast show ${type}`;
|
toast.className = `toast show ${type}`;
|
||||||
const icons = {
|
const icons = {
|
||||||
success: '<i class="fa-regular fa-check-circle" style="margin-right: 8px;"></i>',
|
success: '<i class="fa-regular fa-check-circle" style="margin-right: 8px;"></i>',
|
||||||
|
@ -265,32 +259,43 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||||
warning: '<i class="fa-regular fa-exclamation-triangle" style="margin-right: 8px;"></i>',
|
warning: '<i class="fa-regular fa-exclamation-triangle" style="margin-right: 8px;"></i>',
|
||||||
heart: '<i class="fa-regular fa-heart" style="margin-right: 8px;"></i>'
|
heart: '<i class="fa-regular fa-heart" style="margin-right: 8px;"></i>'
|
||||||
};
|
};
|
||||||
const icon = icons[iconType] || icons["heart"];
|
const icon = icons[iconType] || icons.heart;
|
||||||
toast.innerHTML = `${icon}${message} `;
|
toast.innerHTML = `${icon}${message} `;
|
||||||
const progressBar = document.createElement("div");
|
const progressBar = document.createElement('div');
|
||||||
progressBar.className = "progress-bar";
|
progressBar.className = 'progress-bar';
|
||||||
toast.appendChild(progressBar);
|
toast.appendChild(progressBar);
|
||||||
const closeBtn = document.createElement("button");
|
const closeBtn = document.createElement('button');
|
||||||
closeBtn.className = "toast-close";
|
closeBtn.className = 'toast-close';
|
||||||
closeBtn.innerHTML = '<i class="fa-solid fa-xmark" style="margin-left: 8px; font-size: 0.8em;"></i>';
|
closeBtn.innerHTML = '<i class="fa-solid fa-xmark" style="margin-left: 8px; font-size: 0.8em;"></i>';
|
||||||
closeBtn.addEventListener("click", () => {
|
closeBtn.addEventListener('click', () => {
|
||||||
toast.classList.add("hide");
|
toast.classList.add('hide');
|
||||||
setTimeout(() => toast.remove(), 500);
|
setTimeout(() => toast.remove(), 500);
|
||||||
});
|
});
|
||||||
toast.appendChild(closeBtn);
|
toast.appendChild(closeBtn);
|
||||||
document.body.appendChild(toast);
|
document.body.appendChild(toast);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
toast.classList.add("hide");
|
toast.classList.add('hide');
|
||||||
setTimeout(() => toast.remove(), 500);
|
setTimeout(() => toast.remove(), 500);
|
||||||
}, 3000);
|
}, 3000);
|
||||||
}
|
}
|
||||||
|
|
||||||
function preloadResources(url) {
|
function preloadResources(url) {
|
||||||
const link = document.createElement("link");
|
if (!url) {
|
||||||
link.rel = "preload";
|
console.error('Preload failed: URL is undefined or empty.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const link = document.createElement('link');
|
||||||
|
link.rel = 'preload';
|
||||||
link.href = url;
|
link.href = url;
|
||||||
link.as = "fetch";
|
link.as = 'fetch';
|
||||||
|
link.crossOrigin = 'anonymous';
|
||||||
document.head.appendChild(link);
|
document.head.appendChild(link);
|
||||||
|
console.log(`Resource preloaded: ${url}`);
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error preloading resource:', error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUrl(url) {
|
function getUrl(url) {
|
||||||
|
@ -299,32 +304,23 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
|
||||||
function generateSubject() {
|
function generateSubject() {
|
||||||
const subjects = ['math', 'science', 'history', 'art', 'programming', 'philosophy'];
|
const subjects = ['math', 'science', 'history', 'art', 'programming', 'philosophy'];
|
||||||
const randomSubject = subjects[Math.floor(Math.random() * subjects.length)];
|
const random = subjects[Math.floor(Math.random() * subjects.length)];
|
||||||
history.replaceState({}, '', '/learning?subject=' + randomSubject);
|
history.replaceState({}, '', '/learning?subject=' + random);
|
||||||
}
|
}
|
||||||
|
|
||||||
function decodeUrl(encodedUrl) {
|
function decodeUrl(enc) {
|
||||||
try {
|
try {
|
||||||
const urlObj = new URL(encodedUrl, window.location.origin);
|
const o = new URL(enc, window.location.origin);
|
||||||
const proxyPrefix = (__uv$config && __uv$config.prefix) ? __uv$config.prefix : '/wa/a/';
|
const p = (__uv$config && __uv$config.prefix) || '/wa/a/';
|
||||||
if (urlObj.pathname.startsWith(proxyPrefix)) {
|
if (o.pathname.startsWith(p)) {
|
||||||
const encodedPart = urlObj.pathname.substring(proxyPrefix.length);
|
const part = o.pathname.slice(p.length);
|
||||||
return (__uv$config && typeof __uv$config.decodeUrl === 'function') ?
|
return (__uv$config.decodeUrl ? __uv$config.decodeUrl(part) : decodeURIComponent(part));
|
||||||
__uv$config.decodeUrl(encodedPart) : decodeURIComponent(encodedPart);
|
|
||||||
}
|
}
|
||||||
} catch (e) {}
|
} catch {}
|
||||||
return encodedUrl;
|
return enc;
|
||||||
}
|
}
|
||||||
|
|
||||||
window.decodeUrl = decodeUrl;
|
window.decodeUrl = decodeUrl;
|
||||||
window.addEventListener('message', (event) => {
|
|
||||||
if (event.data && event.data.type === 'uv-url-change' && event.data.url) {
|
|
||||||
if (normalizeUrl(event.data.url) !== normalizeUrl(historyStack[currentIndex] || '')) {
|
|
||||||
addToHistory(event.data.url);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
window.addToHistory = addToHistory;
|
window.addToHistory = addToHistory;
|
||||||
window.updateDecodedSearchInput = updateDecodedSearchInput;
|
window.updateDecodedSearchInput = updateDecodedSearchInput;
|
||||||
window.normalizeUrl = normalizeUrl;
|
window.normalizeUrl = normalizeUrl;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user