Skip to content

Commit acce8c9

Browse files
committed
add process.versions['chromium']
Fix nwjs#1052
1 parent ed66980 commit acce8c9

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

src/nw_version.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343

4444
#define NW_VERSION "v" NW_VERSION_STRING
4545

46+
#define CHROME_VERSION "29.0.1547.31"
4647

4748
#define NW_VERSION_AT_LEAST(major, minor, patch) \
4849
(( (major) < NW_MAJOR_VERSION) \

src/renderer/shell_content_renderer_client.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ void ShellContentRendererClient::InstallNodeSymbols(
318318

319319
// Save node-webkit version
320320
"process.versions['node-webkit'] = '" NW_VERSION_STRING "';"
321+
"process.versions['chromium'] = '" CHROME_VERSION "';"
321322
));
322323
script->Run();
323324
}

src/shell_content_client.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include "base/string_piece.h"
2424
#include "content/nw/src/api/api_messages.h"
25+
#include "content/nw/src/nw_version.h"
2526
#include "content/nw/src/renderer/common/render_messages.h"
2627
#include "ui/base/l10n/l10n_util.h"
2728
#include "ui/base/resource/resource_bundle.h"
@@ -33,7 +34,7 @@ ShellContentClient::~ShellContentClient() {
3334
}
3435

3536
std::string ShellContentClient::GetUserAgent() const {
36-
return webkit_glue::BuildUserAgentFromProduct("Chrome/29.0.1547.31");
37+
return webkit_glue::BuildUserAgentFromProduct("Chrome/" CHROME_VERSION);
3738
}
3839

3940
string16 ShellContentClient::GetLocalizedString(int message_id) const {

0 commit comments

Comments
 (0)