- Clone this
chromerepo into the same folder aseditor-shared, so thesrc/sharedsymlink works for shared files.- Be sure to pull the latest versions of both repos.
- Use a recent version of Node (12 or so) and run
yarnto get dependencies. - Run
yarn build(oryarn watchif iterating).- This generates a
build/extension.jsfile in this directory fromsrc.
- This generates a
- In Chrome, go to
chrome://extensions/and enable Developer Mode in the top right. - Click
Load unpackedand select thechromerepo directory. - Open a new tab, and go to a website like GitHub.
- The extension icon in the top right should turn from monochrome (disabled for certain pages) to orange and black.
- If the client is also running, then it will also register the Chrome plugin as being installed in
~/.serenade/serenade.json, where"plugins"now includes"chrome".
- After iterating on the source, the refresh button at
chrome://extensions/for the unpacked extension needs to be clicked, and the target tab needs to be reloaded for the new build to be used.
- Update the version number in
manifest.json. - Run
yarn dist. - If you've added new files, consider updating the
distcommand inpackage.jsonto include them, ifwebpackdoes not. To test, unzipbuild.zipinto a new directory, likebuild2, and load it in Chrome.
Commands supported:
- Editor state
COMMAND_TYPE_GET_EDITOR_STATECOMMAND_TYPE_SELECTCOMMAND_TYPE_DIFFfor:changecopy/cut/paste <selector>delete <selector>line xtype <text>
- Navigation
backforwardreloadscroll (left | right | up | down)scroll to <text>go to(navigates)
- Tab management
new tabclose tabnext tab,previous tab(first | second ...) tabduplicate tab
- Actions
show (links | inputs | code)to overlay clickable/copyable elementsclick (text | number)to click based on text or previous clickablesuse numberto click or copy previous clickablesCOMMAND_TYPE_CLICKABLEto invalidate alternativesclearto reset overlays
TODO:
- custom
- go to tab
- searching docs