GithubHelp home page GithubHelp logo

wwebjs / moduleraid Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pedroslopez/moduleraid

9.0 4.0 4.0 53 KB

Breaking open Webpack 5/"Comet"(Meta+babel) to extract modules from WhatsApp Web

License: MIT License

JavaScript 100.00%

moduleraid's Introduction

NOTE This package was modified from pixeldesu's original moduleRaid for compatibility with webpack v5 used in WhatsApp Web. No support will be given outside of anything strictly necessary to extract modules in WhatsApp Web.

moduleRaid

moduleRaid is a utility to get modules from webpackChunkbuild functions embedded on WhatsApp Web. It also provides functions to search through returned modules.

Installation

You can get moduleRaid over npm

$ npm install @pedroslopez/moduleRaid

Or if you directly want to use it in the browser

<script src="https://unpkg.com/@pedroslopez/moduleraid@latest/moduleraid.js"></script>

Alternatively, just copy the script from moduleraid.js and run it in a devtool console.

Usage

Preparation

Using moduleRaid as a module, simply require and execute it somewhere where it will end up as a public facing script

const moduleRaid = require('moduleraid')

window.mR = moduleRaid()

If you a running the script from the console or loading it over a service like unpkg, no further need for preparations!

The moduleraid object

Once moduleRaid is run or included on a page that includes a Webpack build (usually noted by a webpackJsonp function), it will return a object, containing:

  • modules: An object containing all modules we could get from Webpack
  • constructors: An array containing all module constructor functions
  • get(id): Get the module from the specified id
  • findModule(query): Return the module that has query as a key in its exports
  • findFunction(query): Return functions that include query (query can be either a string or a function)

If you run the code in devtools or load it as external script from unpkg/etc. the moduleRaid object can be found in window.mR by default.

Note: If moduleRaid had to get modules through iteration, constructors will be empty and so findFunction will not work.

Debug Mode

If you call moduleRaid with an optional argument true, you will enable debug output. Debug output will show errors that are normally supressed.

In the version that is minified and you can't just add another argument easily, simply run window.mRdebug = true before adding the script and you should be fine!

License

moduleRaid is licensed under the MIT License

moduleraid's People

Contributors

pixeldesu avatar pedroslopez avatar purpshell avatar eramdam avatar

Stargazers

Aurora Jun avatar Ubaldo Porcheddu avatar  avatar  avatar Jesaja Everling avatar Erick Moura avatar M Dedi Rudianto avatar David Miller avatar  avatar

Watchers

Jesaja Everling avatar Erick Moura avatar  avatar  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.