Plugins

Add editor plugins for more kinds of files and page plugins for the browser, where to put them, and how one is made.

Two kinds of plugin

  • Editor plugins open files the app has no editor for. The HL7, X12 and EDIFACT editors are editor plugins.
  • Page plugins are scripts the browser panels put into the web pages they are for, such as one that skips YouTube's ads.

Both are free downloads on the Plugins pages, each a .zip of the plugin's folder. Every plugin there is listed with its SHA-256, to check the download against.

An editor plugin runs in the app's window and can do what the app's own editors do; a page plugin acts in the pages it is for. Add plugins only from where the app comes from, or from someone you trust.

Adding an editor plugin

  1. Download the plugin's .zip.
  2. Beside Panora Navigator.exe, make a folder named plugins if there is none. For the portable version, that is beside the portable .exe, not where it unpacks itself when it runs.
  3. Unpack the .zip into a folder of its own in there, so that its plugin.json is, for example, in plugins\hl7\plugin.json.
  4. Start the app again.
Panora Navigator.exe
plugins\
  hl7\        plugin.json, index.js, index.css, data\
  x12\
  edifact\

From then on its files open in it, as with the app's own editors. For an extension the app has an editor for too, the plugin's goes first; Open with still offers the others.

To update a plugin, unpack the new version over the old folder. To remove one, delete its folder. Each plugin says which version of the app's plugin API it is built for; one built for another version is not loaded, and the Plugins pages say which each version needs.

Adding a page plugin

  1. Download the plugin's .zip and unpack it into a folder of its own.
  2. In a browser panel, open the menu at the end of the toolbar and choose Page plugins.
  3. Click Add… and pick the plugin's plugin.json.

The app copies the plugin into its data folder, so the unpacked folder can be removed afterwards. Adding a plugin with the id of one that is there already replaces it, which is how a page plugin is updated.

The plugin runs from the next load of a page it is for. A tab whose page has a plugin running shows a mark before its title: point at it to see which plugins, click it to open Page plugins.

In Page plugins each plugin has a switch to turn it off and on, and a button to remove it. A plugin turned off or removed stays in the pages it is running in until they are loaded again. Open folder opens the folder the app keeps them in.

Making a page plugin

A page plugin is two files in a folder: plugin.json and its script.

{
  "id": "youtube-skip-ads",
  "name": "YouTube: skip ads",
  "version": "1.0.0",
  "description": "Clicks “Skip” on a YouTube ad as soon as the ad can be skipped.",
  "matches": ["*://*.youtube.com/*"],
  "script": "script.js"
}
Field
idRequired. Lower-case letters, digits and dashes.
name, version, descriptionShown in Page plugins.
matchesRequired. The addresses of the pages it is for. * is anything; *://*.site.com/* is site.com and every name under it; <all_urls> is every page. A mask without a path (*://site.com) is the whole site.
scriptRequired. The script's file name, beside plugin.json.
world"page" to run with the page's own scripts, when the plugin needs the page's objects. Leave it out otherwise: the script then runs in a world of its own, which the page's scripts cannot see.

The script runs in the top page once the document is ready, once per document. A site that changes its address without loading again, as YouTube does, gets it too when it comes to a matching address. The script is wrapped in a function of its own, and is given plugin:

  • plugin.id, plugin.name;
  • plugin.log(...), which writes to the page's console (F12), prefixed with the plugin's name;
  • plugin.click(element), which clicks the middle of the element the way the mouse does, so that the page takes it as a real click. Some pages ignore a script's element.click().

The folder the app keeps the plugins in is read again each time a page loads: to try a change, edit the script there (Open folder) and reload the page.

Editor plugins

An editor plugin is built from the app's sources: an ES module that uses the app's React, Ant Design and theme, with a plugin.json that names its editors and viewers and the extensions they open. How one is made is described in the README of the app's sources.

Did not find what you were looking for? Ask a question