Created
March 8, 2019 12:05
-
-
Save loujaybee/4c2f9b5ffdba7dd6e884d71bc9369cb8 to your computer and use it in GitHub Desktop.
Toggle DAZN 2.0 / 1.0 (add to your bookmarks)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: | |
function createCookie(name,value,days) { | |
if (days) { | |
var date = new Date(); | |
date.setTime(date.getTime() + (days * 24 * 60 * 60 *1000)); | |
var expires = "; expires=" + date.toGMTString(); | |
} else { | |
var expires = ""; | |
} | |
document.cookie = name + "=" + value + expires + "; path=/"; | |
} | |
function readCookie(name) { | |
var nameEQ = name + "="; | |
var ca = document.cookie.split(';'); | |
for(var i=0;i < ca.length;i++) { | |
var c = ca[i]; | |
while (c.charAt(0)==' ') { | |
c = c.substring(1,c.length); | |
} | |
if (c.indexOf(nameEQ) == 0) { | |
return c.substring(nameEQ.length,c.length); | |
} | |
} | |
return null; | |
} | |
function eraseCookie(name) { | |
createCookie(name,"",-1); | |
} | |
var cookie = readCookie('_dfe_v'); | |
if (!cookie) createCookie('_dfe_v', 100, 100); | |
else if (cookie == 0) createCookie('_dfe_v', 100, 100); | |
else if (cookie == 100) createCookie('_dfe_v', 0, 100); | |
else createCookie('_dfe_v', 0, 100); | |
var version = readCookie('_dfe_v') == 100 ? '1.0' : '2.0'; | |
console.log(`You\'ve swapped to ${version}, please refresh!`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment