From d908f4c81e71ef7db4d086afcf72af84f34b9cdb Mon Sep 17 00:00:00 2001 From: "Alex Xu (Hello71)" Date: Thu, 4 Oct 2018 18:57:41 -0400 Subject: Update --- crsq.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'crsq.js') diff --git a/crsq.js b/crsq.js index 289a739..1b1e186 100644 --- a/crsq.js +++ b/crsq.js @@ -34,7 +34,7 @@ xhr.onreadystatechange = function () { // emulate document.write script // use if statement instead of conditional operator to pacify AMO auto reviewer var s = xhr.responseXML.body.querySelector("script").parentNode; - if (/(?:mayaauth|mayaanyoneauth)/.test(document.cookie)) { + if (/(?:mayaauth|mayaanyoneauth)=/.test(document.cookie)) { s.innerHTML = '


All About Passport York

'; } else { s.innerHTML = '
New Student?
All about Passport York
'; @@ -43,7 +43,7 @@ xhr.onreadystatechange = function () { var avs = xhr .responseXML .evaluate( - '//a[contains(text(), "Please click here to see availability.")]', + '//a[contains(text(), "Please click here to see availability")]', xhr.responseXML.body ); var avsa = []; @@ -51,12 +51,10 @@ xhr.onreadystatechange = function () { while ((av = avs.iterateNext())) avsa.push(av); avsa.forEach(function (av) { - var newHref = av.href - .replace(/(https?:\/\/[^.\/]*\.sis\.yorku\.ca\/Apps\/WebObjects\/cdm\.woa\/wa\/loginppy\?url=).*/, - "$1" + encodeURIComponent(location.pathname + location.search + location.hash) - ); - if (newHref != av.href) - av.href = newHref; + var newSearch = av.search.replace(/url=[^&]*/, + "url=" + encodeURIComponent(location.pathname + location.search + location.hash)); + if (newSearch != av.search) + av.search = newSearch; }); document.body.replaceChild(xhr.responseXML.body.children[0], document.body.children[0]); -- cgit v1.2.3-54-g00ecf