Low-level DOM API concepts

Basically, the DOM is the API surface. Low-level API provides methods for
decorating, replacing, and styling DOM elements exposed through a set of
endpoints.

PolyGerrit provides a simple way for accessing the DOM via DOM hooks API. A DOM
hook is a custom element that is instantiated for the plugin endpoint. In the
decoration case, a hook is set with a content attribute that points to the DOM
element.

Get the DOM hook API instance via plugin.hook(endpointName)

Set up an onAttached callback

Callback is called when the hook element is created and inserted into DOM

Styling DOM Elements

A plugin may provide Polymer’s
style
modules to style individual endpoints using
plugin.registerStyleModule(endpointName, moduleName). A style must be defined
as a standalone <dom-module> defined in the same .html file.

changeMetadata

theme

url

Deprecated APIs

Some of the deprecated APIs have limited implementation in PolyGerrit to serve
as a "stepping stone" to allow gradual migration.

install

plugin.deprecated.install()

Params:

none

Replaces plugin APIs with a deprecated version. This allows use of deprecated
APIs without changing JS code. For example, onAction is not available by
default, and after plugin.deprecated.install() it’s accessible via
self.onAction().