Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e74a334
feat: read the plugin hub's catalog and download from it with a size cap
CodySimonds65 Oct 3, 2026
93e0719
feat: build, verify and safely unpack plugin packages
CodySimonds65 Oct 3, 2026
8cf4d27
feat: decide which hub plugins may run, and install, update and remov…
CodySimonds65 Oct 3, 2026
2b24a92
feat: add the hub tool that checks a submission and builds the catalog
CodySimonds65 Oct 3, 2026
c028c8a
fix: read a hostile hub catalog quickly and strictly, and check hub a…
CodySimonds65 Oct 3, 2026
51c1bfd
feat: open links only on a plugin's declared sites, and mark communit…
CodySimonds65 Oct 3, 2026
554158d
feat: run installed hub plugins beside dev plugins, each starting on …
CodySimonds65 Oct 3, 2026
6a0c6f7
fix: keep hub installs and their record safe from corrupt files, race…
CodySimonds65 Oct 3, 2026
eb55bcd
fix: bound how deep a package can nest, and keep packages to files ev…
CodySimonds65 Oct 3, 2026
a8d9646
fix: make the hub tool refuse bad input loudly and tell the reviewer …
CodySimonds65 Oct 3, 2026
f28bd77
fix: keep the author visible in the community bar, and open exactly t…
CodySimonds65 Oct 3, 2026
d95264f
fix: never start a hub plugin before the user's settings are known, a…
CodySimonds65 Oct 3, 2026
dafebb5
feat: add the plugin hub page to the plugin panel
CodySimonds65 Oct 3, 2026
b8a9097
feat: check the plugin hub, and install, update and uninstall its plu…
CodySimonds65 Oct 3, 2026
8129318
fix: refuse site names that aren't plain host names, and keep every s…
CodySimonds65 Oct 3, 2026
cfc5a29
fix: show any-website access before install, keep the hub page quick,…
CodySimonds65 Oct 3, 2026
8df3086
docs: explain the plugin hub to users and plugin authors
CodySimonds65 Oct 3, 2026
a154b4f
fix: give hub downloads a time limit, and ask before uninstalling a p…
CodySimonds65 Oct 3, 2026
48a7dae
docs: correct the hub rules an author meets on a first submission
CodySimonds65 Oct 3, 2026
d435001
fix: tell the truth about a plugin that needs a newer FourFold, and c…
CodySimonds65 Oct 3, 2026
39b4a0f
docs: name two submission rules the guide left out
CodySimonds65 Oct 3, 2026
5ffa5d3
feat: add a Refresh button to the plugin hub page
CodySimonds65 Oct 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions FourFoldAccountManager.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FourFoldAccountManager.Lead
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FourFoldAccountManager.Desktop.Tests", "src\FourFoldAccountManager.Desktop.Tests\FourFoldAccountManager.Desktop.Tests.csproj", "{B1001A02-C503-4CC9-9BF3-473EE45297D0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FourFoldAccountManager.HubTool", "src\FourFoldAccountManager.HubTool\FourFoldAccountManager.HubTool.csproj", "{4C1F820F-039F-4288-9458-F78626241946}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -99,6 +101,18 @@ Global
{B1001A02-C503-4CC9-9BF3-473EE45297D0}.Release|x64.Build.0 = Release|Any CPU
{B1001A02-C503-4CC9-9BF3-473EE45297D0}.Release|x86.ActiveCfg = Release|Any CPU
{B1001A02-C503-4CC9-9BF3-473EE45297D0}.Release|x86.Build.0 = Release|Any CPU
{4C1F820F-039F-4288-9458-F78626241946}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4C1F820F-039F-4288-9458-F78626241946}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4C1F820F-039F-4288-9458-F78626241946}.Debug|x64.ActiveCfg = Debug|Any CPU
{4C1F820F-039F-4288-9458-F78626241946}.Debug|x64.Build.0 = Debug|Any CPU
{4C1F820F-039F-4288-9458-F78626241946}.Debug|x86.ActiveCfg = Debug|Any CPU
{4C1F820F-039F-4288-9458-F78626241946}.Debug|x86.Build.0 = Debug|Any CPU
{4C1F820F-039F-4288-9458-F78626241946}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4C1F820F-039F-4288-9458-F78626241946}.Release|Any CPU.Build.0 = Release|Any CPU
{4C1F820F-039F-4288-9458-F78626241946}.Release|x64.ActiveCfg = Release|Any CPU
{4C1F820F-039F-4288-9458-F78626241946}.Release|x64.Build.0 = Release|Any CPU
{4C1F820F-039F-4288-9458-F78626241946}.Release|x86.ActiveCfg = Release|Any CPU
{4C1F820F-039F-4288-9458-F78626241946}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -110,5 +124,6 @@ Global
{8DC5AD11-A59F-445F-84AC-D10C5F7A9C17} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
{B3971592-86AD-488E-85E2-8C9F87A41670} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
{B1001A02-C503-4CC9-9BF3-473EE45297D0} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
{4C1F820F-039F-4288-9458-F78626241946} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
EndGlobalSection
EndGlobal
90 changes: 78 additions & 12 deletions PLUGIN_AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ The page runs in its own sandboxed browser. It talks to FourFold only through `w

The page keeps running while its panel is closed, so its cards stay up to date. It stops when the user switches the plugin off or closes FourFold. It runs whenever the plugin is switched on: when FourFold starts, on **Reload**, and on every file save in the dev folder. Keep start-up work light.

The panel is narrow: about 250 px wide in the main window, and as wide as the window allows in the pop-out tools window. Design a single narrow column.
The panel is narrow: about 250 px wide in the main window, and as wide as the window allows in the pop-out tools window. Design a single narrow column. FourFold draws a 24-pixel bar at the top of the panel, above your page. It shows the plugin's name, its author and a COMMUNITY tag (DEV for a plugin in the dev folder), and a long name or author is shortened with an ellipsis. Your page gets the rest of the panel.

## Quick start

Users get plugins from the plugin hub: they open the plugin list (the wrench in the plugin strip) and choose **Plugin hub**. The dev folder is for authors, to try a plugin before it is submitted. To submit one, see [Getting on the hub](#getting-on-the-hub).

1. Open the plugin list (the wrench in the plugin strip).
2. Switch on **Developer mode**, at the bottom of the list.
3. Press **Open dev plugins folder**. It is `%LOCALAPPDATA%\FourFoldAccountManager\dev-plugins`.
Expand All @@ -37,7 +39,7 @@ Every folder directly inside `dev-plugins` is one plugin.
- **F5** reloads the plugin's page.
- **Developer mode off** stops every dev plugin and removes it from the strip. Order and on/off state are kept.

Dev plugins are not reviewed, and FourFold honors their `plugin.json` as written. Right now the dev folder is the only place a community plugin can run.
Dev plugins are not reviewed, and FourFold honors their `plugin.json` as written. While developer mode is on, a dev plugin runs instead of an installed hub plugin with the same id.

## plugin.json

Expand Down Expand Up @@ -71,8 +73,8 @@ A `plugin.json` that breaks any rule below is rejected: the plugin doesn't load,
| `apiVersion` | yes | A whole number. FourFold supports `1`. A higher number is rejected with "Update FourFold to use this plugin." |
| `panel` | yes | Path to an existing `.html` file inside the plugin folder. Forward slashes only. |
| `icon` | no | Path to a `.png` file inside the plugin folder, at most 256 by 256 pixels and 64 KB. Forward slashes only. Without one, the strip shows a default icon. |
| `sites` | no | At most 10 websites the plugin may contact. Each is an origin: `https://host` or `https://host:port`, with no path, query or `user@`. The host must be a DNS name: no IP address, no trailing dot, and no name that only works on the local network. `localhost`, `.localhost`, `.local`, `.internal`, `.lan` and `.home.arpa` names are refused, and so is a single-label name such as `router`. A subdomain is its own site, so `https://example.com` doesn't cover `https://www.example.com`. |
| `anySite` | no | `true` lets the plugin contact any `https` site. Default `false`. FourFold honors it for plugins in the dev folder. |
| `sites` | no | At most 10 websites the plugin may contact. Each is an origin: `https://host` or `https://host:port`, with no path, query or `user@`. The host must be a DNS name: no IP address, no trailing dot, and no name that only works on the local network. `localhost`, `.localhost`, `.local`, `.internal`, `.lan` and `.home.arpa` names are refused, and so is a single-label name such as `router`. A subdomain is its own site, so `https://example.com` doesn't cover `https://www.example.com`. An international host name is fine: FourFold converts it to its `xn--` form, and that form is what it shows users. After the conversion the host can contain only letters, digits, dots and dashes, so a name with an underscore or any other punctuation is refused. |
| `anySite` | no | `true` lets the plugin contact any `https` site. Default `false`. FourFold honors it for plugins in the dev folder. A plugin from the plugin hub gets it only when the maintainers also approve it there. See [Getting on the hub](#getting-on-the-hub). |
| `cards` | no | At most 6 overlay cards. See [Cards](#cards). |

Each entry in `cards`:
Expand Down Expand Up @@ -177,7 +179,7 @@ console.log(response.status, response.text.length);

`fourfold.http.fetch(url, { method, headers, body })` returns `{ status, headers, text }`. FourFold makes the request, not your page, so it isn't subject to CORS. Only `url` is required.

- **Where:** a site in your `sites`, or any `https` site if the plugin has `anySite`. The host name must match exactly. Plain `http` never works. A site on the local network never works, and FourFold also checks the addresses the host name resolves to.
- **Where:** a site in your `sites`, or any `https` site if the plugin has `anySite` and FourFold honors it. The host name must match exactly. Plain `http` never works. A site on the local network never works, and FourFold also checks the addresses the host name resolves to.
- **Method:** `GET` (default) or `POST`.
- **`body`:** must be a string, so `JSON.stringify` an object yourself. A body that isn't a string is sent empty, and `body` is ignored for `GET`. It is sent as UTF-8 with a `text/plain` content type unless you set `Content-Type` in `headers`.
- **`headers`:** an object of strings. A name must be a valid header name, and a value must be printable ASCII, or the call fails with `invalid-argument`. `Cookie`, `Host`, `Content-Length`, `Transfer-Encoding`, `Connection`, `Proxy-*` and `Sec-*` are dropped. FourFold sends `User-Agent: FourFold-Plugin/1` unless you set your own.
Expand All @@ -194,10 +196,11 @@ button.addEventListener('click', () => {
});
```

`fourfold.openExternal(url)` opens an `https` link in the user's default browser.
`fourfold.openExternal(url)` opens an `https` link in the user's default browser. The example works because the `plugin.json` above declares `https://wiki.example.com`.

- The URL must be `https`, with no `user@`, and not `localhost`, a `.localhost`, `.local`, `.internal`, `.lan` or `.home.arpa` name, a single-label name such as `router`, or a local network address (`invalid-argument`).
- It works only while the plugin's panel is showing, and only in response to a click (`unavailable`).
- A URL that isn't a valid `https` link fails with `invalid-argument`. That covers other schemes, a `user@` part, `localhost`, a `.localhost`, `.local`, `.internal`, `.lan` or `.home.arpa` name, a single-label name such as `router`, a local network address, and a host name that can't be converted to a real host name.
- The link must be on one of the plugin's `sites`, with the same host and port, or on any public host if the plugin has `anySite` and FourFold honors it. The path and query can be anything. A link to any other site fails with `site-not-allowed`.
- It works only while the plugin's panel is showing, and only right after the user clicks or presses a key in your page. Otherwise it fails with `unavailable`.
- At most one link every 2 seconds (`limit-exceeded`).

### Storage
Expand Down Expand Up @@ -259,9 +262,9 @@ body { background: var(--ff-surface); color: var(--ff-text); }
|---|---|
| `invalid-argument` | A parameter is missing or wrong: an unknown account id, a missing or bad key, URL, header or method, control characters or a `progress` outside 0 to 1 in a card, a method FourFold doesn't have. |
| `not-declared` | `cards.set` or `cards.clear` for a card id that isn't in `plugin.json`. |
| `site-not-allowed` | `http.fetch` to a site that isn't allowed: not in `sites`, not `https`, or on the local network. This includes a redirect to such a site. |
| `site-not-allowed` | `http.fetch` to a site that isn't allowed: not in `sites`, not `https`, or on the local network. This includes a redirect to such a site. `openExternal` to an `https` site the plugin isn't allowed to contact also gets this code. |
| `limit-exceeded` | A size, rate or count limit. See the table below. |
| `unavailable` | FourFold couldn't do it right now: storage can't be read, a web request failed or took longer than 15 seconds, `openExternal` with no click or no panel showing, or an unexpected failure. |
| `unavailable` | FourFold couldn't do it right now: storage can't be read, a web request failed or took longer than 15 seconds, `openExternal` with no recent click or key press, or no panel showing, or an unexpected failure. |

### Limits

Expand Down Expand Up @@ -307,7 +310,7 @@ Every response carries a content security policy. For a plugin that declares `ht
default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; font-src 'self'; img-src 'self' data: https://example.com; connect-src 'self' https://example.com wss://example.com; frame-src 'none'; worker-src 'none'; webrtc 'block'; object-src 'none'; base-uri 'none'; form-action 'none'
```

With `anySite`, `img-src` and `connect-src` accept `https:` in place of the declared sites. WebSockets still need a declared site. The developer tools console may warn about an unknown `webrtc` directive in this policy. It is harmless.
When FourFold honors `anySite`, `img-src` and `connect-src` accept `https:` in place of the declared sites. WebSockets still need a declared site. The developer tools console may warn about an unknown `webrtc` directive in this policy. It is harmless.

What that means for you:

Expand Down Expand Up @@ -393,4 +396,67 @@ If the user switches the plugin off in the plugin list, its cards are hidden eve

## Getting on the hub

Publishing to the plugin hub, and review by FourFold's maintainers, is coming.
FourFold installs plugins only from its plugin hub, and its maintainers review every plugin before it is listed.
The hub is a GitHub repository:
[FourFoldAccountManager-plugin-hub](https://github.com/CodySimonds65/FourFoldAccountManager-plugin-hub).

1. Put your plugin in a public GitHub repository, at the root or in a folder.
2. Test the exact commit you want listed, with developer mode on. The hub's check (step 4) runs on Linux, where
names are case-sensitive. `panel`, `icon` and `path` must match the real file and folder names letter for
letter, even though Windows lets a mismatch work in the dev folder.
3. Open a pull request on the hub that adds your entry file, `plugins/<your plugin id>.json`:

```json
{
"repository": "https://github.com/you/your-plugin",
"commit": "0123456789abcdef0123456789abcdef01234567"
}
```

`repository` must be exactly `https://github.com/owner/repo`, with no trailing slash, no `/tree/...` and no `.git`
at the end. `commit` is the full 40-character commit in lowercase. Add `"path"` when the plugin is in a folder.
`path` is written with forward slashes, uses only letters, digits, `.`, `_` and `-`, has no trailing slash, no `.`
or `..` parts, and at most 200 characters. The pull request changes only that one file.
4. A check validates your `plugin.json` with the same rules FourFold uses, builds the package (the zip that users
install), and scans the files in your repository at that commit for secrets. If the check fails, its summary page
says why. Fix it in your plugin's repository (then put the new commit in your entry file), or in the entry file
itself. Then a maintainer reads the code. When they merge, the plugin is on the hub.

The check downloads your whole repository at that commit, not only the plugin's folder. It must be public, under
50 MB as a download, at most 200 MB once unpacked, and hold at most 20,000 files. No path in your repository can
have more than 63 parts, counting the folders from the repository root and the file's name.

To update, raise `version` in `plugin.json` and open a pull request that changes `commit` in your entry file. Users
get the new version automatically once it is merged: FourFold checks the hub when it starts and every 6 hours.

A `version` is three numbers joined by dots, such as `1.4.0`, and each number can be at most 2147483647. The check
refuses a version it can't compare, and an update must raise it, comparing number by number (`1.10.0` is higher than
`1.9.0`).

What goes into the package: `plugin.json` and every file of a type FourFold serves (see
[Where your page runs](#where-your-page-runs)) in the plugin's folder (the repository root, or `path`). At most 500
files and 5 MB in all. Every such file goes in, whether or not your page loads it, so keep tests and screenshots
outside the plugin's folder (put the plugin in a folder and set `path`), or in a folder whose name starts with a
dot. Everything else is left out, such as `README.md` and `LICENSE`, and so is any file or folder whose
name starts with a dot. Your panel page, and everything it loads, must be in the package, so none of them can start
with a dot. The files that go in must also unpack on Windows:

- A file or folder name can't contain `< > " | ? *` or a control character, and can't end in a dot or a space. A
file with a `\` or a `:` in its path is left out.
- A file or folder can't be named like a Windows device: `con`, `prn`, `aux`, `nul`, `com0` to `com9` or `lpt0` to
`lpt9`, in any case, alone or before a dot. `aux.js` is refused, and `auxiliary.js` is fine.
- Two files can't differ only by capital letters.

A user can uninstall a plugin: FourFold asks first, and uninstalling deletes the plugin's saved data. If the
maintainers remove a plugin from the hub, FourFold stops it for everyone who has it and shows them why. Its saved
data is kept until they uninstall it.

**Never put a secret key in a plugin.** Everything in a plugin is public and runs on users' machines. A plugin that
needs a secret key can't be listed.

A plugin gets access to any website only when it asks for it in `plugin.json` **and** a maintainer approves it on the
hub. Ask in your pull request and say why. Users see "Can contact any website" next to a plugin that has it in the hub
before they install it. For every other plugin, the hub's **Details** list the sites it declares.

The hub's [README](https://github.com/CodySimonds65/FourFoldAccountManager-plugin-hub#readme) has the rest of the
submission rules: what a pull request may change, the secret scan and any-website access.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ A Windows client for running several FourFold accounts side by side, each in its
- **Layouts**: run up to five games in a grid, or give each account its own tab.
- **Theatre mode and full screen**: hide everything but the games.
- **Plugins**: XP tracker, stats, XP calculator and a speedrun timer in a RuneLite-style strip. Click an icon to open its panel, drag icons to reorder them, and use the wrench to switch plugins off or change the Timer's keys. The button at the right of the toolbar hides or shows the strip.
- **Community plugins (in development)**: plugin authors can build sandboxed web plugins and test them from a local dev folder. See [PLUGIN_AUTHORS.md](PLUGIN_AUTHORS.md).
- **Community plugins**: open the plugin list (the wrench) and choose **Plugin hub** to search and install plugins made by the community. Every plugin is reviewed before it is listed, runs in a sandbox, and updates itself. To make one, see [PLUGIN_AUTHORS.md](PLUGIN_AUTHORS.md).
- **Overlays**: drag XP/hr, stats, XP calc and timer cards anywhere over the game.
- **Second monitor**: pop the tools panel into its own window, or float individual cards on any screen.
- **Shared XP leaderboard**: daily, weekly and monthly XP gains across opted-in players.
Expand Down
Loading