openwebrxplus-plugins

This utility plugin will give a function wrapping method and will send some events.
This plugin is a dependency for almost all plugins.

Features

Load

Add this lines in your init.js file (await ensures it finishes before dependents):

await Plugins.load('https://0xaf.github.io/openwebrxplus-plugins/receiver/utils/utils.js');
// load the rest of your plugins here

init.js

Learn how to load plugins.

API

Plugins.utils.wrap_func(name, before_cb, after_cb, obj)

Wrap a function and intercept calls before and/or after execution.

Plugins.utils.on_ready(callback)

Run callback once OpenWebRX+ has completed initialization.

Plugins.utils.observe_mutations(targets, options, callback, run_now)

Create one or more MutationObserver instances with a shared callback.

Returns an array of handles: { observer, target, disconnect }.

Example:

var handles = Plugins.utils.observe_mutations(
  [tabEl, rootEl],
  { attributes: true, attributeFilter: ['class'] },
  function () {
    refreshVisibility();
  },
  true
);

Plugins.utils.disconnect_observers(handles)

Disconnect handles returned by observe_mutations().

Plugins.utils.disconnect_observers(handles);

Code

Code is in the Github repo.