Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added ico/os/win11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions inc/StatisticsLogger.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down Expand Up @@ -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);
Expand Down
16 changes: 15 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var plugin_statistics = {
/**
* initialize the script
*/
init: function () {
init: async function () {

// load visitor cookie
var now = new Date();
Expand All @@ -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');
Expand Down