From 2655e12d9031fb839d399765fb769d5a379766d0 Mon Sep 17 00:00:00 2001 From: hippoz <10706925-hippoz@users.noreply.gitlab.com> Date: Tue, 27 Sep 2022 16:23:50 +0300 Subject: [PATCH] typo --- doc/plugins.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/plugins.md b/doc/plugins.md index 0db5abd..583b802 100644 --- a/doc/plugins.md +++ b/doc/plugins.md @@ -8,14 +8,14 @@ Plugins are pieces of Javascript that run on the web frontend. They get access t Waffle also supports loading CSS using the `app:stylesheets` localstorage item (array of strings which contain css code). -Here's some general rules of thumb: +Here's some general info about plugins: - There is no dedicated plugin API yet. Plugins simply get access to internal objects. This is because it is very difficult to create a good plugin API which covers most usecases. This also means plugins are liable to break with updates. - The less "intrusive" the change, the less likely it is to break with an update: if your plugin uses `Proxy` on a bunch of internal functions and relies on weird behavior, it is very likely to break with an update. - Never use `window.__waffle` in your plugin. It is designed for easy access into internal objects from the browser devtools. Plugins get the same access through the objects passed in `plugin.main`. The difference is that the plugin context can have certain differences in implementation and structure to ensure compatibility and safety. ## Loading -The client supports 2 ways of loading plugins: +The client supports 3 ways of loading plugins: 1. Automatic loading: the client iterates over all of the strings in the `app:javascript` localstorage array and executes them as Javascript. 2. Manual loading: done using a script that runs before the frontend's javascript, such as a userscript, a script injected in the HTML, or a WebExtension. 3. Pasting in the console: pasting the code of a plugin in the console. Useful for development, or when you don't have access to localstorage or userscripts.