The out of bounds didn't work with edge, as this cuts into the title. So this should improve the experience.

This commit is contained in:
Robin Krom 2020-10-22 16:16:00 +02:00
commit 1aedebd57c
2 changed files with 26 additions and 3 deletions

View file

@ -1,8 +1,31 @@
<script language="JavaScript"> <script language="JavaScript">
var searchQuery = window.location.search;
var searchQuery = window.location.search.substring(1);
var vars = searchQuery.split('&');
function getQueryVariable(variable) {
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split('=');
if (decodeURIComponent(pair[0]) == variable) {
return decodeURIComponent(pair[1]);
}
}
return null;
}
if (searchQuery && searchQuery.length >= 1) { if (searchQuery && searchQuery.length >= 1) {
var oldTitle = (window.document.title === undefined) ? "" : window.document.title; var oldTitle = (window.document.title === undefined) ? "" : window.document.title;
window.document.title=oldTitle + "||" + searchQuery.substring(1) + "||"; var state=getQueryVariable("state");
var code=getQueryVariable("code");
var error=getQueryVariable("error") || "unknown";
if (error == null && (state || code)) {
window.document.title=oldTitle + "?state=" + state + "&code=" + code;
} else {
window.document.title=oldTitle + "?error=" + error;
}
}
else {
window.document.title=oldTitle + "?error=noquery";
} }
</script> </script>

View file

@ -1,6 +1,6 @@
--- ---
layout: oauth layout: oauth
title: Greenshot authenticated with Imgur title: Imgur
permalink: /oauth/imgur permalink: /oauth/imgur
categories: [oauth] categories: [oauth]
tags: [uses_alerts] tags: [uses_alerts]