Spector.js icon indicating copy to clipboard operation
Spector.js copied to clipboard

Does not work in Electron

Open BigPhilCombo opened this issue 7 years ago • 5 comments

When running in electron using the BrowserWindow.addDevToolsExtension() method - the extensions will generate the following error

Uncaught ReferenceError: browser is not defined at chrome-extension://spector-js/contentScript.js:10:9 at chrome-extension://spector-js/contentScript.js:11:3 at runContentScript (D:\Projects\gsi_xtream\node_modules\electron\dist\resources\electron.asar\renderer\content-scripts-injector.js:23:26) at Object.onceWrapper (events.js:314:30) at emitNone (events.js:105:13) at process.emit (events.js:207:7)

BigPhilCombo avatar Nov 01 '17 14:11 BigPhilCombo

Hi,

I have never tried installing the extension on from Electron. Could you rely on the npm package embedded in your page as a workaround ?

sebavan avatar Nov 01 '17 16:11 sebavan

That works thanks. I do think you should still try to enable the extension for Electron use but this will do for this project. Thanks again.

BigPhilCombo avatar Nov 01 '17 16:11 BigPhilCombo

No problem, I ll keep it as an enhancement for 2.0

sebavan avatar Nov 01 '17 20:11 sebavan

How do I activate and record using Spector.js inside an Electron application? In chrome, there is a toolbar button that you need to press to get the record button, but there is no button that appears in Electron by default.

mmakrzem avatar Jan 10 '18 18:01 mmakrzem

You need currently to rely on the embedded tools either through the module as the support for Electron has not been developped: https://github.com/BabylonJS/Spector.js#webpack-sample or through the script directly: https://github.com/BabylonJS/Spector.js#use-as-a-script-reference by installing the npm package.

sebavan avatar Jan 11 '18 08:01 sebavan