violentmonkey: [BUG] GM.info.platform gets the wrong browser version in MAXTHON
Problem:
GM.info.platform gets the wrong browser version in MAXTHON, browserVersion should be 109.0.0.0.
GM.info.platform:
{
"arch": "x86-64",
"os": "win",
"browserBrand": "Chromium",
"brand": "Chromium",
"browserName": "chrome",
"name": "chrome",
"browserVersion": "7.2.2.3200",
"version": "7.2.2.3200"
}
navigator.userAgentData:
{
"brands": [
{
"brand": "Chromium",
"version": "109"
},
{
"brand": "Not_A Brand",
"version": "99"
}
],
"mobile": false,
"platform": "Windows"
}
Environment:
- OS: Windows11
- Browser: MAXTHON 7.2.2.3200 (Chromium 190.0.0.0)
- Violentmonkey Version: BETA v2.20.1
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 49 (27 by maintainers)
Hi @tophf,
uaFullVersionis Deprecated. see #uafullversion.fullVersionListshould be used instead.And MAXTHON return navigator.userAgentData.getHighEntropyValues([‘fullVersionList’]) like this:
I think this is very irresponsible brand information. The correct brand information should be:
Of course, this has nothing to do with the extension itself, as I mentioned above, it’s a problem caused by the browser developers.
GM_info.platform.browserVersion in Chromium-based browsers is parsed from navigator.userAgentData.getHighEntropyValues or navigator.userAgent of the background script, not from navigator.userAgentData.brands, because it’s a browserVersion, not browserBrandVersion. In other browsers we use browser.runtime.getBrowserInfo, which is implemented only in Gecko/Firefox, AFAIK, and potentially some obscure browsers like Orion.
Edit: in modern Chromium-based browsers we use navigator.userAgentData.getHighEntropyValues([‘uaFullVersion’]).
The browser information obtained by extensions is not absolutely correct. This is especially true for unofficial or third-party forkes of the Chromium browser, whose developers don’t follow the agreed-upon data structures for defining browser information, but instead arbitrarily modify browser brand and brand version information. This can cause extensions to fetch browser information that is not correct. This is the case with Maxthon as you mentioned.
So i think @tophf is right about that.
This is the correct behavior, because this extension doesn’t use chrome.debugger API. If what you described were true, it would be a critical bug in the browser’s implementation of security boundary for extensions.
I don’t know and there’s a separate issue for that.