Skip to content
Benjamin Häublein edited this page Nov 11, 2017 · 2 revisions

Plugins are an easy way to extend the user interface.

Installation

Copy the plugin file to the js/plugins/ directory in your password-manager instance. Then in password.php add a line similar to

<script type="text/javascript" src="js/plugins/linkButton.js"></script>

after the line

<script type="text/javascript" src="js/plugin.js"></script>

Plugins are loaded in line order.

To activate the plugin you probably have to clear the browser cache.

Development

A plugins consist of a javascript file that implements hooks for the password manager functions.

Currently the hooks in this table are supported:

Hook Parameters
readAccount {"account":accountarray[index]}
accountsReady
fieldsReady {"fields":fields, "accounts":accountarray}
readField {"field":fields[x]}
drawAccount {"account": accounts[index], "row":row}
editAccountDialog {"account": accountarray[id]}
layoutReady"
showDetails {"account":accountarray[i], "out":s}

Example Hook

registerPlugin("showDetails",function(data){
    console.log(data);
});

A plugin consisting of this hook will show the parameters passed to it in the developer console after clicking the details button of an account entry.