Code Monkey home page Code Monkey logo

whatsapp-bulk-send's Introduction

Whatsapp Bulk Sender

dependencies Status devDependencies Status

Chrome extension built with React 16+ and Webpack 4+

Open the extension in a new tab, load your whatsapp messages to be sent, and wait for the job to be completed.

Installing and Running

  1. Ensure Node.js version is >= 8.
  2. Run npm install to install the dependencies.
  3. Run npm start, this will create a build folder
  4. Load the extension on Chrome following:
    1. Access chrome://extensions/
    2. Check Developer mode
    3. Click on Load unpacked extension
    4. Select the build folder.

Structure

All the extension's code is placed in the src folder.

Webpack auto-reload and HRM

To make the workflow much more efficient this project uses the webpack server for development (started with npm start) with auto reload feature that reloads the browser extension automatically every time that we save some file in the editor.

To run the dev mode on other port, just specify the env var port like this:

$ PORT=6002 npm run start

Content Scripts

Although this project uses the webpack dev server, it's also prepared to write all the bundles files on the disk at every code change. So we can point, on the extension manifest, to the bundles that we want to use as content scripts, but we need to exclude these entry points from hot reloading (why?). To do so we need to expose which entry points are content scripts on the webpack.config.js using the chromeExtensionCustomOpts -> notHotReload config.

For example, if we want to use the myContentScript entry point as content script, we will configure the entry point and exclude it from hot reloading, like this:

on webpack.config.js:

{
  
  entry: {
    myContentScript: "./src/js/myContentScript.js"
  },
  chromeExtensionCustomOpts: {
    notHotReload: ["myContentScript"]
  }
  
}

and on src/manifest.json:

{
  "content_scripts": [
    {
      "matches": ["https://www.google.com/*"],
      "js": ["myContentScript.bundle.js"]
    }
  ]
}

Deploying

After the development of the 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.

Secrets

Just import the file ./secrets.<THE-NODE_ENV>.js on the modules through the module named as secrets, so we 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.

Resources:


Credits

  • Michael Xieyang Liu | Website - for providing the boilerplate this project started off

whatsapp-bulk-send's People

Contributors

tmilar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.