- Check if your Node.js version is >= 6.
- Clone the repository.
- Install yarn.
- Run
yarn
. - Change the package's name and description on
package.json
. - Change the name of your extension on
src/manifest.json
. - Run
npm run start
- Load your extension on Chrome following:
- Access
chrome://extensions/
- Check
Developer mode
- Click on
Load unpacked extension
- Select the
build
folder.
- Access
- Have fun.
- All the development code is placed in
src
folder. - src/manifest.json is how we edit the manifest file of the chrome app.
Read more at https://github.com/samuelsimoes/chrome-extension-webpack-boilerplate#structure
To make your workflow much more efficient this boilerplate uses the webpack server to development (started with npm run server
) with auto reload feature that reloads the browser automatically every time that you save some file o your editor.
You can run the dev mode on other port if you want. Just specify the env var port
like this:
$ PORT=6002 npm run start
h2m='cd <path to this folder>'
h2m_run='h2m; npm run start'
After the development of your extension run the command
$ NODE_ENV=production npm run build
Now, the content of build
folder will be the extension ready to be submitted to the Chrome Web Store. Just take a look at the official guide to more infos about publishing.
If you are developing an extension that talks with some API you probably are using different keys for testing and production. Is a good practice you not commit your secret keys and expose to anyone that have access to the repository.
To this task this boilerplate import the file ./secrets.<THE-NODE_ENV>.js
on your modules through the module named as secrets
, so you can do things like this:
./secrets.development.js
export default { key: "123" };
./src/popup.js
import secrets from "secrets";
ApiCall({ key: secrets.key });
👉 The files with name secrets.*.js
already are ignored on the repository.
- Better Design
- Refresh option
- spec
- framework
- Better control over navigation and tab switching.
- Democratise the html parsing/scraping using Mammoth.
- Build a community of contributors.
- Make JavaScript a language of data scientists.
HTML is a flexible formats and everyone has done their own thing when making websites. So it is not possible to write generic code that can parse everything.
Hence it is important that this extension is flexible. It should be possible to customise this extension by allowing custom specifiers, parsers, data generators etc.
Specifiers that could be allowed
- Domain
- Sub domain
- url path
- other url parts like query string etc.
- jquery selector
- xpath
- custom parser
- Custom data generators.
Also we should be able to define negative lists with this so this extension can be disbled easily where not needed.
This will allow us to add custom html parsers anywhere on the web.
Once we have achieved the right spec, anyone in the world should be able to contribute and help us customise this tool
- User should be able to define their own custom script to parse the html. Like StyleBot (http://stylebot.me/) for data parsing. This might not be possible because this means script injection. I do not know, just documenting thoughts without research
- User should be able to save their script.
- User should be able to download a script from someone else.
- Create an issue, it's a good place to start.
- Create PR if you can solve any of the reported issues.
- On your PR make sure that you are following the current codebase style.
- Your PR must be single purpose. Resolve just one problem on your PR.
- Make sure to commit in the same style that we are committing until now on the project.
- Help with documentation is also appreciated.
- used this boilerplate template: https://github.com/samuelsimoes/chrome-extension-webpack-boilerplate