Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
Provide process.version to webui and component extensions
Browse files Browse the repository at this point in the history
It was erroring with:

```
_stream_writable.js
var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate :
```

because our webpack config sets process to false and the process object
we provide doesn't have a version property until now.

processNextTick;

Related to brave/browser-laptop#5981
  • Loading branch information
bbondy committed Jan 16, 2017
1 parent aeecf6b commit a1c7592
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "extensions/renderer/resource_bundle_source_map.h"
#include "extensions/renderer/v8_helpers.h"
#include "gin/converter.h"
#include "vendor/node/src/node_version.h"
#if defined(OS_WIN)
#include "base/win/windows_version.h"
#endif
Expand Down Expand Up @@ -61,6 +62,9 @@ v8::Local<v8::Value> GetOrCreateProcess(ScriptContext* context) {
gin::SetProperty(context->isolate(), process.As<v8::Object>(),
ToV8StringUnsafe(context->isolate(), "type"),
ToV8StringUnsafe(context->isolate(), "renderer"));
gin::SetProperty(context->isolate(), process.As<v8::Object>(),
ToV8StringUnsafe(context->isolate(), "version"),
ToV8StringUnsafe(context->isolate(), NODE_VERSION_STRING));
gin::SetProperty(context->isolate(), process.As<v8::Object>(),
ToV8StringUnsafe(context->isolate(), "platform"),
ToV8StringUnsafe(context->isolate(), kPlatform));
Expand Down

1 comment on commit a1c7592

@bbondy
Copy link
Member Author

@bbondy bbondy commented on a1c7592 Jan 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was erroring when loading a magnet URL via the urlbar inside the content dev tools console.

Please sign in to comment.