From 5b2062daeb60172df4e0882477c57ef770cc08ca Mon Sep 17 00:00:00 2001 From: Robin Krom Date: Thu, 22 Oct 2020 23:37:08 +0200 Subject: [PATCH] As the title got to large, it's now providing every field single and changing the title quickly. --- _includes/oauth-out-of-bounds.html | 75 +++++++++++++++++++----------- 1 file changed, 47 insertions(+), 28 deletions(-) diff --git a/_includes/oauth-out-of-bounds.html b/_includes/oauth-out-of-bounds.html index fec0aa917..8a463d528 100644 --- a/_includes/oauth-out-of-bounds.html +++ b/_includes/oauth-out-of-bounds.html @@ -1,31 +1,50 @@ + + var index = 0; + var titles = []; + var nrOfTitles = 0; + function updateTitle() { + if (index >= nrOfTitles) { + index = 0; + } + window.document.title = titles[index]; + index = index+1; + } + + if (searchQuery && searchQuery.length >= 1) { + var state = getQueryVariable("state"); + var error = getQueryVariable("error"); + + if (error == null && (state || code)) { + var numberOfArguments = vars.length; + nrOfTitles = numberOfArguments -1; + for (var i = 0; i < numberOfArguments; i++) { + var pair = vars[i].split('='); + if (decodeURIComponent(pair[0]) == "state") { + continue; + } + titles.push(oldTitle + "?nr=" + numberOfArguments + "&state=" + state + "&" + decodeURIComponent(pair[0]) + "=" + decodeURIComponent(pair[1])); + } + // Update the title in a loop + setInterval(updateTitle, 100); + } else { + window.document.title = oldTitle + "?error=" + error; + } + } + else { + window.document.title = oldTitle + "?error=noquery"; + } + \ No newline at end of file