Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 qlmanage (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.

qlmanage 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.

like image 228
Pierre Avatar asked Oct 07 '16 17:10

Pierre


1 Answers

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!

like image 149
Pierre Avatar answered Oct 15 '22 18:10

Pierre