diff --git a/README.md b/README.md index 24657bc..f2b2a29 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # uiDivStats - WebUI for Diversion statistics ## v4.0.17 -### Updated on 2026-Apr-24 +### Updated on 2026-Jun-24 ## About A graphical representation of domain blocking performed by Diversion. diff --git a/uiDivStats.sh b/uiDivStats.sh index 07871d8..d33c231 100644 --- a/uiDivStats.sh +++ b/uiDivStats.sh @@ -13,7 +13,7 @@ ## Forked from https://github.com/jackyaz/uiDivStats ## ## ## ################################################################### -# Last Modified: 2026-Apr-24 +# Last Modified: 2026-Jun-24 #------------------------------------------------------------------ ################# Shellcheck directives ############### @@ -36,7 +36,7 @@ ### Start of script variables ### readonly SCRIPT_NAME="uiDivStats" readonly SCRIPT_VERSION="v4.0.17" -readonly SCRIPT_VERSTAG="26042400" +readonly SCRIPT_VERSTAG="26062400" SCRIPT_BRANCH="develop" SCRIPT_REPO="https://raw.githubusercontent.com/AMTM-OSR/$SCRIPT_NAME/$SCRIPT_BRANCH" readonly SCRIPT_DIR="/jffs/addons/$SCRIPT_NAME.d" diff --git a/uidivstats_www.asp b/uidivstats_www.asp index c5566f0..d41b791 100644 --- a/uidivstats_www.asp +++ b/uidivstats_www.asp @@ -30,9 +30,9 @@ p{font-weight:bolder}thead.collapsible-jquery{color:#fff;padding:0;width:100%;bo diff --git a/uidivstats_www.js b/uidivstats_www.js index b3e34d0..0ad6258 100644 --- a/uidivstats_www.js +++ b/uidivstats_www.js @@ -1,5 +1,5 @@ /**----------------------------**/ -/** Last Modified: 2026-Jan-18 **/ +/** Last Modified: 2026-Jun-24 **/ /**----------------------------**/ var maxNoChartsBlocked = 6; @@ -600,6 +600,35 @@ function LogarithmicFormatter(tickValue,index,ticks) } }; +/**----------------------------------------------------------------** + ** Compatibility layer for the latest AsusWRT6 routers, such as + ** the GT-BE19000AI, where the previous global 'cookie' helper + ** functions defined in the 'state.js' file are now removed in + ** favour of using the "window.localStorage" property. + **----------------------------------------------------------------**/ +if (typeof window.cookie === "undefined" || + typeof window.cookie.get !== "function" || + typeof window.cookie.set !== "function") +{ + window.cookie = { + get: function (key) { + return window.localStorage.getItem(key); + }, + + /** In the previous 'cookie' function a 3rd argument was given for 'days' **/ + /** Here, we ignore the value because there is no expiration date anymore **/ + set: function (key, value, days) { + window.localStorage.setItem(key, String(value)); + }, + + unset: function (key) { + window.localStorage.removeItem(key); + } + }; + + console.log("Installed localStorage compatibility for cookie API."); +} + function GetCookie(cookiename,returntype) { if (cookie.get('uidivstats_'+cookiename) !== null)