Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Update main.js

Cette révision appartient à :
kilo 2017-07-23 02:40:39 +02:00 révisé par GitHub
Parent 02df6b7310
révision fb06f72139

Voir le fichier

@ -60,10 +60,16 @@ parseAllDates()
//Get current lang, mascot & theme cookies
//TODO
//Remove all cookies
//Remove all cookies:
var cookies = document.cookie.split(";");
for (var i = 0; i < cookies.length; i++)
document.cookie = cookies[i].split("=")[0] + "=;expires=Thu, 01 Jan 1970 00:00:00 UTC;";
var excludedCookies = ["mascot", "theme", "mascot_url", "lang"];
for (var i = 0; i < cookies.length; i++) {
var cookieName = (cookies[i].split("=")[0]).trim();
//Remove spaces because some cookie names have it
if(excludedCookies.includes(cookieName)) continue;
document.cookie = cookieName + "=;expires=Thu, 01 Jan 1970 00:00:00 UTC;";
}
//Set new version in cookie
document.cookie = "version=" + Version;