2-4 Minute Read
Swirl Plugin Guide
How Swirl plugins are structured and loaded.
Important Notice
Swirl plugins directly modify the Swirl Browser Application and can be used for malicious purposes. Only download trusted plugins and be sure to review the code they package (if possible).
How Swirl plugins are structured
Swirl plugins are really just folders on your disk – but they need to be structured in a very specific way for Swirl to understand them.
Here is an example of a well-made Swirl plugin folder:
Plugin/
├── utils/
│ └── helper.lua
├── assets/
│ └── icon.png
├── plugin.json
└── main.lua
plugin.json
A plugin.json file gives Swirl info about said plugin. plugin.json files are very simple and a full example can be found below:
{
"name": "Plugin",
"icon": "assets/icon.png",
"author": "Stephen Byrne",
"version": 1.0
}
Scripts
Lua scripts in the root of the plugin folder will be executed automatically line-by-line. Thus, you should keep files intended to be required by other scripts in separate folders.
For instance; ./utils/helper.lua would not automatically be executed – but ./main.lua would.
Written by: Stephen Byrne