Skip to content

Commit 047636c

Browse files
committed
Fix nwjs#5975: Add %chromium_ver to user-agent field in manifest
1 parent 44f34c0 commit 047636c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

docs/References/Manifest Format.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ The following placeholders are available to composite the user agent dynamically
8686
* `%name`: replaced by the `name` field in the manifest.
8787
* `%ver`: replaced by the `version` field in the manifest, if available.
8888
* `%nwver`: replaced by the version of NW.js.
89-
* `%webkit_ver`: replaced by the version of WebKit engine.
89+
* `%webkit_ver`: replaced by the version of Blink engine.
90+
* `%chromium_ver`: replaced by the Chromium version
9091
* `%osinfo`: replaced by the OS and CPU information you would see in browser's user agent string.
9192

9293
### node-remote

src/common/nw_content_common_hooks.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "content/nw/src/nw_package.h"
1414
#include "content/nw/src/nw_version.h"
1515

16+
#include "chrome/common/chrome_version.h"
1617
namespace nw {
1718

1819
namespace {
@@ -48,6 +49,7 @@ void SetUserAgentOverride(const std::string& agent,
4849
base::ReplaceSubstringsAfterOffset(&g_user_agent, 0, "%nwver", NW_VERSION_STRING);
4950
base::ReplaceSubstringsAfterOffset(&g_user_agent, 0, "%webkit_ver", content::GetWebKitVersion());
5051
base::ReplaceSubstringsAfterOffset(&g_user_agent, 0, "%osinfo", content::BuildOSInfo());
52+
base::ReplaceSubstringsAfterOffset(&g_user_agent, 0, "%chromium_ver", CHROME_VERSION_STRING);
5153
}
5254

53-
} // nw
55+
} // nw

0 commit comments

Comments
 (0)