diff --git a/tdx-enhanced.js b/tdx-enhanced.js index 419bd48..b53d0ed 100644 --- a/tdx-enhanced.js +++ b/tdx-enhanced.js @@ -1,10 +1,11 @@ // ==UserScript== // @name tdx-enhanced // @namespace ecn -// @version 2024-05-14-03 +// @version 2024-07-17-01 // @description enhanced tdx coloring & formatting. follows system color scheme. // @author Purdue STEM IT - it@purdue.edu // @match https://service.purdue.edu/TDNext/* +// @match https://service.purdue.edu/TDWebApi/* // @require https://momentjs.com/downloads/moment.min.js // @require https://cdnjs.cloudflare.com/ajax/libs/tinycolor/1.6.0/tinycolor.min.js // @downloadURL https://raw.github.itap.purdue.edu/ECN/tdx-userscript/main/tdx-enhanced.js @@ -556,9 +557,23 @@ } } + function checkPath() { + let path = document.location.pathname + if (path=="/TDWebApi/api/auth/loginsso") { + let pre = document.querySelector("pre") + if (pre) { + console.log("Got key!",pre.innerText) + let key = pre.innerText + window.opener.postMessage({tdxkey:key},"https://engineering.purdue.edu") + window.close() + } + } + } + changeTitle() checkColorMode() parseTicket() + checkPath() const customStyles = `