Skip to content
raingart edited this page Mar 22, 2024 · 20 revisions

To understand the basic functionality, check out plugin example

The structure is plain JSON.

plugin example

A plugin consists of 3 logical parts

  1. description
  2. execution function
  3. list of settings options

Description

It can be divided into two groups: necessary and optional necessary are also divided into two types:

  • Required only for launch
  • Required for generation on the settings page

Minimum required:

  • 'id' - unique identifier. Needed to store information about plugin activation/deactivation. The string type, - is used as a word separator.
  • 'run_on_pages' - the name of the url (location.pathname) on which the plugin will be launched. Specified with a comma.
  • '_runtime' - The function that will be called when the plugin starts. Essentially the "code to be executed" of the plugin. The function takes one single argument user_settings - a list of all user settings in JSON/Object format (key:value).

Options to launch include:

  • restart_on_location_change - Indicates that the _runtime function should be restarted every time the url (location.pathname) changes. Provided that the new url matches those specified in run_on_pages

To optional for generation in settings page:

  • 'title' - plugin name (on one line)
  • 'section' - logical group in which the plugin will be displayed
  • 'desc' - tooltip when hovering over plugin (html title tag)
  • 'options' - JSON subgroup with a list of options

options

options example

For example, let's analyze such an object

'option_name_to_save': {
    _tagName: 'input',
    label: 'Smooth',
    type: 'checkbox',
    title: 'Help info',
    'data-dependent': { 'another_option_name': true },
},
  • 'option_name_to_save' - the name that the specific option will be stored. Word separator is underscore _
  • '_tagName' - html form tag name. Available: 'input', 'select'
  • 'label' - the visual name of the option that will be inserted into the 'label' tag next to the element specified in '_tagName'.
  • 'type' - an important parameter indicating the type of hero specified in '_tagName' In fact, all other additional value keys point to attributes html : value

The unusual ones are 'data-dependent': { 'another_option_name': true }, - used to show when activated or specific knowledge it depends on

Available functions inside the '_runtime' function

An up-to-date complete list can be found in /plugins/nova-api.js

Adding to Nova

For the extension, add the path to the array in the file /js/plugins.js

For Userscript add the plugin after this window.nova_plugins = [];

PLAYER SECTION

CONTROL PANEL SECTION

OTHER SECTION

THUMBS SECTION

COMMENTS SECTION

DETAILS SECTION

DETAILS BUTTONS SECTION

SIDEBAR SECTION

PLAYLIST SECTION

HEADER SECTION

Clone this wiki locally