adopted-ember-addons / ember-electron

:zap: Build, test, compile and package desktop apps with Ember and Electron
https://ember-electron.js.org/
Other
805 stars 109 forks source link

Any way to activiate the "Inspect Ember Component" option from Ember Inspector? #1820

Open jagthedrummer opened 2 months ago

jagthedrummer commented 2 months ago

Is there a way to get the "Inspect Ember Component" option from Ember Inspector in an Ember Electron app?

CleanShot 2024-09-10 at 22 55 05@2x

The Inspector itself is working for me in EE, but that particular option is missing, so it can be hard to figure out where something is coming from in a "bottom up" manner via right click and inspect.

CleanShot 2024-09-10 at 22 57 24@2x

bendemboski commented 2 months ago

I'm really not sure. The first thing I'd try is upgrading to the latest Ember Inspector. If you're using the latest ember-electron blueprint, you'll have a line that looks like

await installExtension(EMBER_INSPECTOR, {
  loadExtensionOptions: { allowFileAccess: true },
});

where those symbols are imported from electron-extension-installer. EMBER_INSPECTOR is version 4.9.1, but it looks like you could just replace it with

await installExtension({
  id: 'bmdblncegkenkacieihfhpjfppoconhi',
  version: '4.13.1',
}, {
  loadExtensionOptions: { allowFileAccess: true },
});

and see if it works. If the extension itself doesn't work, we'll have to dig into that. If it does, I'm still not sure if it will automatically install those context menu items -- I'm just not sure about the details of the integration between the extension and Chrome vs Chrome/Electron. If it doesn't you probably need to dig into the extension or reach out to the Ember Inspector folks to ask for guidance on how you could use Electron's context menu API to generate an item that calls into the extension to invoke that functionality when clicked.

Please do report back on what you find -- I'd love to upgrade to the latest Ember Inspector and also get that context menu item, I just haven't had time to look into it myself.