Attention: This plugin could lead to account restrictions if used on facebook.com. It's intended as a starting point for Chrome/Firefox plugin implementations using the Elm programming language.
- determines the language of the <html> tag of the page the plugin is running in
- determines the URL of the page the plugin is running in
- has a generic state machine that executes a sequence of actions:
- Click on an element with a certain selector
- Click on an element with a certain text
- Click on an element inside another element
- Retrieve text from an element
- Store a retrieved value
- Erase a stored value
- Wait for an element to appear
- Wait for a certain URL (pattern)
- Fill text into an element
- Fill text into a contenteditable element
- Focus an element
- Conditionally skip actions (goto in state machine)
- src/Main.elm Main Elm program logic. Makes use of the state machine to execute a sequence of actions on the current website
- src/Ports.elm Interface to the JS part. Sends and receives messages.
- src/StateMachine.elm Executes actions on behalf of the user.
- background.js Forwards messages from Elm, see also elm-import.js
- content.js JS Implementation of the actions triggered by StateMachine.elm
- elm-import.js Creates the Elm program, passes Flags, interfaces Elm Port messages with background.js / content.js
- elm.json Elm project file
- manifest.json Plugin manifest file. In firefox/manifest.json is a slightly different version for Firefox plugins
- popup.html The plugin UI, references the compiled Elm program
- publish.sh Prepares the plugin for distribution in dist/chrome and dist/firefox. For Firefox additionally s2f-source.zip is created for source distribution.