Problem creating a Socket with Primus in Electron

Hello, I have some problem using Primus in electron. Here is my index.html page:

<html>
  <head>
<meta charset="UTF-8">
<title>Hello World!</title>
  </head>
  <body>
<h1>Hello World!</h1>
   <script type="text/javascript" >

  async function test() {
    var Primus = require("primus")
     var url = "https://proxyconnection.touch.dofus.com/primus/?STICKER=dz45Sde5f6SDert4";
     console.log("creating socket");
     const PrimusSocket = Primus.createSocket({transformer: "engine.io",});
     console.log("nouvelle instance");
     const primus = new PrimusSocket(url);

     primus.on("open", () => {
       console.log("open");
     })
     primus.on("data", data => {
       console.log("message received : " + data._messageType);
     })
     primus.on("reconnected", () => {
       console.log('reconnect');
     })
     primus.on("error", error => {
       logger.error(new Error(error));
     })
     primus.on("end", () => {
       console.log("end");
     })
     primus.open();
   }


  test();
   </script>
  </body>
</html>

It stop just after the “creating socket” log, and I hav only a warning message in the console telling “[Deprecation] ‘window.webkitStorageInfo’ is deprecated”. Any idea?

Here is my main.js file:

const { app, BrowserWindow } = require('electron')

function createWindow () {
  // Cree la fenetre du navigateur.
  let win = new BrowserWindow({
    width: 800,
    height: 600,
    webPreferences: {
      nodeIntegration: true
    }
  })

  // and load the index.html of the app.
  win.loadFile('index.html')


      // Ouvre les DevTools.
      win.webContents.openDevTools()
}

app.on('ready', createWindow)

and my package.json:

{
  "name": "my-app",
  "version": "0.1.0",
  "main": "main.js",
  "scripts": {
    "start": "electron ."
  },
  "dependencies": {
    "primus": "^7.3.3"
  }
}

I’m getting a similar warning in console. Although, I’m not using Primus.

'window.webkitStorageInfo' is deprecated. Please use 'navigator.webkitTemporaryStorage' or 'navigator.webkitPersistentStorage' instead.

Just remote.require-ing a function that executes child_process’s execSync

electron@6.0.9
node@12.10.0

Is this something to do with native modules & context aware?

Found & fixed my issue. I was mistakenly passing a browser event object to a main process method. Electron was serializing that object & hence those warnings were showing up.