diff --git a/ico/os/win11.png b/ico/os/win11.png new file mode 100644 index 0000000..2daab92 Binary files /dev/null and b/ico/os/win11.png differ diff --git a/inc/StatisticsLogger.class.php b/inc/StatisticsLogger.class.php index ecc00bd..f4d28bb 100644 --- a/inc/StatisticsLogger.class.php +++ b/inc/StatisticsLogger.class.php @@ -325,7 +325,7 @@ public function log_access() { $ua = addslashes($this->ua_agent); $ua_type = addslashes($this->ua_type); $ua_ver = addslashes($this->ua_version); - $os = addslashes($this->ua_platform); + $os = $_REQUEST['os'] ? $_REQUEST['os'] : addslashes($this->ua_platform); $ua_info = addslashes($this->ua_name); $page = addslashes($_REQUEST['p']); @@ -398,7 +398,7 @@ public function log_media($media, $mime, $inline, $size) { $ua = addslashes($this->ua_agent); $ua_type = addslashes($this->ua_type); $ua_ver = addslashes($this->ua_version); - $os = addslashes($this->ua_platform); + $os = $_REQUEST['os'] ? $_REQUEST['os'] : addslashes($this->ua_platform); $ua_info = addslashes($this->ua_name); $media = addslashes($media); diff --git a/script.js b/script.js index 4f4c4e1..6349136 100644 --- a/script.js +++ b/script.js @@ -7,7 +7,7 @@ var plugin_statistics = { /** * initialize the script */ - init: function () { + init: async function () { // load visitor cookie var now = new Date(); @@ -30,6 +30,20 @@ var plugin_statistics = { rnd: now.getTime() }; + try { + await navigator.userAgentData.getHighEntropyValues(["platformVersion"]) + .then(ua => { + if (navigator.userAgentData.platform === "Windows") { + const majorPlatformVersion = parseInt(ua.platformVersion.split('.')[0]); + if (majorPlatformVersion >= 13) { + plugin_statistics.data.os = "Win11"; + } + } + }); + } catch(error) { + // console.log(error); + } + // log access if (JSINFO['act'] == 'show') { plugin_statistics.log_view('v');