Petal Cite Browser Extension
January 4, 2023 · View on GitHub
Building
git clone --recursive https://github.com/ks-collab/cite-extension.gitcd cite-extensionyarn installyarn build
The build are built in build/.
Running from the build directory
Chrome
- Go to chrome://extensions/
- Enable "Developer Mode".
- Click "Load unpacked extension…" and select the
builddirectory.
Firefox
- Go to about:debugging
- Click "Load Temporary Add-on" and select the
build/manifest.jsonfile.
Safari
- Make sure you have Safari 14 and Xcode 12 installed
- In the terminal, convert the extension to be Safari compatibale
xcrun safari-web-extension-converter <your build folder> - Click Run to launch the extension
- Safari will be opened
- Safari -> preferences -> enable development menu
- Safari -> develop menu -> click allow unsigned extension (need to do this every time safari is restarted)
- Safari -> preferences -> extensions tab -> click the extension
- open an website on Safari, click the icon near the address bar, and allow the access
Automatic rebuilding/reloading
Chrome on MacOS
brew install chrome-clinpm install -g gulpcdto project rootyarn installyarn buildgulp watch-chrome
As files are changed, the extension will be rebuilt automatically and Chrome will reload the extension.
Firefox
- Get and install the Mozilla web-ext tool
cdto project rootyarn installyarn buildgulp watch./scripts/run_xpi(in a different terminal window)
As files are changed, the extension will be rebuilt automatically and Firefox will reload the extension.
Others
cdto project rootnpm installyarn buildgulp watch
As files are changed, the extension will be rebuilt automatically. You will need to manually reload the extension in the browser being developed for.
Developing
Technologies
Chrome/Firefox Browser Extension Framework
The functionality exposed on Chrome and Firefox is provided by the Chrome extension framework, which has also been adopted by Firefox. See Chrome Extension docs and Firefox Extension docs for more information.
Safari extension converter
Safari version was converted from Chrome/Firefox version by using safari-web-extension-converter provided by Apple. See Converting a web extension for Safari for more details.
Contact
If you have any questions about this extension you can email us at help@petal.org.