Embedding a Unity3d webplayer


Hi there,

I’m trying to run Unity3D webplayer content within an Electron app, is this possible?
(Note: I’m not talking about WebGL but content that requires the traditional Unity3D webplayer plugin)

Chrome started to deprecate NPAPI support starting from v42.x and removed all functionality with v45.x, which makes Electron v31 the last version I can potentially use for a test.

By default NPAPI support is disabled, so I needed to enabled it by passing “web-preferences”: {“plugins”: true} to the BrowserWindow constructor.

Just to make sure plugins are supported I also added two appendSwitch calls to the main thread.

So my main.js looks something like this:

var app = require('app');  // Module to control application life.

var BrowserWindow = require('browser-window');  // Module to create native browser window.

// Report crashes to our server.

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the javascript object is GCed.
var mainWindow = null;

// Quit when all windows are closed.
app.on('window-all-closed', function() {
  if (process.platform != 'darwin')

// This method will be called when atom-shell has done everything
// initialization and ready for creating browser windows.
app.on('ready', function() {
  // Create the browser window.
  mainWindow = new BrowserWindow({width: 800, height: 600, "web-preferences": {"plugins": true, "web-security": false}});

  // and load the index.html of the app.

  // Open the devtools.
  // Emitted when the window is closed.
  mainWindow.on('closed', function() {
    // Dereference the window object, usually you would store windows
    // in an array if your app supports multi windows, this is the time
    // when you should delete the corresponding element.
    mainWindow = null;

To keep things simple I used the default ‘hello world’ electron sample app, and just replaced the loadURL call with ‘http://unity3d.com/webplayer’, where a standard unity webplayer is hosted.

I got Flash plugins working, but unfortunately no Unity3D webplayer content is running.
Not even the console is throwing any errors or hints…

Any thoughts on this one?



Have you had any luck with this?


it should work for you. The last version of electron where you can enable unity3D player is 0.31.2. It has chromium version which supports the Unity3Dplayer.

check out this post