Add process.versions['chrome'], fixes #675
This commit is contained in:
parent
ee5335ca6e
commit
cc4897f8c1
2 changed files with 6 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "atom/common/atom_version.h"
|
#include "atom/common/atom_version.h"
|
||||||
|
#include "atom/common/chrome_version.h"
|
||||||
#include "atom/common/native_mate_converters/string16_converter.h"
|
#include "atom/common/native_mate_converters/string16_converter.h"
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "native_mate/callback.h"
|
#include "native_mate/callback.h"
|
||||||
|
@ -78,9 +79,12 @@ void AtomBindings::BindTo(v8::Isolate* isolate,
|
||||||
base::Bind(&AtomBindings::ActivateUVLoop, base::Unretained(this)));
|
base::Bind(&AtomBindings::ActivateUVLoop, base::Unretained(this)));
|
||||||
|
|
||||||
v8::Handle<v8::Object> versions;
|
v8::Handle<v8::Object> versions;
|
||||||
if (dict.Get("versions", &versions))
|
if (dict.Get("versions", &versions)) {
|
||||||
versions->Set(mate::StringToV8(isolate, "atom-shell"),
|
versions->Set(mate::StringToV8(isolate, "atom-shell"),
|
||||||
mate::StringToV8(isolate, ATOM_VERSION_STRING));
|
mate::StringToV8(isolate, ATOM_VERSION_STRING));
|
||||||
|
versions->Set(mate::StringToV8(isolate, "chrome"),
|
||||||
|
mate::StringToV8(isolate, CHROME_VERSION_STRING));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AtomBindings::ActivateUVLoop(v8::Isolate* isolate) {
|
void AtomBindings::ActivateUVLoop(v8::Isolate* isolate) {
|
||||||
|
|
|
@ -5,4 +5,5 @@ upstream node:
|
||||||
|
|
||||||
* `process.type` String - Process's type, can be `browser` or `renderer`.
|
* `process.type` String - Process's type, can be `browser` or `renderer`.
|
||||||
* `process.versions['atom-shell']` String - Version of atom-shell.
|
* `process.versions['atom-shell']` String - Version of atom-shell.
|
||||||
|
* `process.versions['chrome']` String - Version of Chromium.
|
||||||
* `process.resourcesPath` String - Path to JavaScript source codes.
|
* `process.resourcesPath` String - Path to JavaScript source codes.
|
||||||
|
|
Loading…
Reference in a new issue