Use this repo as a template for creating your own Suman Chrome Extension plugin.
You can clone this project, make your changes, then push to Github, and Github can host your plugin.
To load your plugin from Github, you use a link like so:
https://rawgit.com/sumanjs/sce-plugin-template/master/dist/plugin.js
in general terms, that is:
https://rawgit.com/<org>/<repo>/<branch-or-commithash>/dist/plugin.js
Using the branchname (like "master") is fine since SCE will reload your plugin
from the URL everytime the app is loaded - caching is off in the browser, since
SCE uses fetch(url, {cache:'no-store'})
.
However, caching might be on from the Github standpoint, and in that case, use the commit hash or develop your plugin on localhost before publishing.
- Install typecript
npm install -g typescript
- Install webpack
npm install -g webpack
To develop your own plugin, do it locally.
-
Clone this project using https.
-
Use
src/index.ts
as the entrypoint of your plugin - you must exportSCEPlugin
as a class from index.ts. -
Build your plugin using
./scripts/build.sh
-
Locally, serve your plugin to SCE, using
./scripts/dev.sh
-
Open SCE using Chrome, and then on the homepage click settings, paste the URL to your plugin and click load plugin.
-
Your plugin can be hosted locally with localhost, or on Github or Gitlab.
See this video for a step-by-step guide to developing your own plugin for SCE:
[tbd]