Pierre Pierre - 11 months ago 83
Node.js Question

Using QLPreviewPanel with Electron

We are looking into migrating our Objc Application to an Electron one, since the native one is just a WebWrapper around a website already.

We are missing one important feature: the ability to use QuickLook to preview files.

We managed to wrap

(Quick Look Server debug and management tool) in a npm module (based on this older code) but this is not the same as using QLPreviewPanel.

launches an app in the Dock, and can spawn multiple instances of it, unlike QLpreviewPanel.

enter image description here

  • Does anyone managed to use Quicklook properly with Electron?

  • Is it possible to create a npm module in C++ using the Foundation Framework from Apple, and then requiring this module from Electron?

Any insight would be greatly appreciated.

Answer Source

We ended up adding this feature directly in Electron.

This will be released soon on the BrowserWindow api, with the following method signature:

previewFile(path [,displayname])

This way everyone gets to use it!