|
4 | 4 | <img width=200px src='.github/logo.png?raw=true'> |
5 | 5 |
|
6 | 6 | <h1>moduleRaid</h1> |
7 | | - <p>moduleRaid is a utility to get modules and module constructors from <code>webpackJsonp</code> functions embedded on websites by Webpack. It also provides functions to search through returned modules.</p> |
| 7 | + <p>moduleRaid is a utility to get modules from <code>webpackChunkbuild</code> functions embedded on WhatsApp Web. It also provides functions to search through returned modules.</p> |
8 | 8 | </div> |
9 | 9 |
|
10 | 10 | <h2 align='center'>Installation</h2> |
11 | 11 |
|
12 | 12 | You can get moduleRaid over npm |
13 | 13 |
|
14 | 14 | ``` |
15 | | -$ npm install moduleraid |
| 15 | +$ npm install @pedroslopez/moduleRaid |
16 | 16 | ``` |
17 | 17 |
|
18 | 18 | Or if you directly want to use it in the browser |
19 | 19 |
|
20 | 20 | ```html |
21 | | -< script src= "https://unpkg.com/[email protected]/moduleraid.js"></ script> |
22 | | -<!-- minified --> |
23 | | -< script src= "https://unpkg.com/[email protected]/moduleraid.min.js"></ script> |
| 21 | +<script src="https://unpkg.com/@pedroslopez/moduleraid@latest/moduleraid.js"></script> |
24 | 22 | ``` |
25 | 23 |
|
26 | | -Alternatively, just copy the script from `moduleraid.js` and run it in a devtool console |
27 | | -on the site of your choosing. |
| 24 | +Alternatively, just copy the script from `moduleraid.js` and run it in a devtool console. |
28 | 25 |
|
29 | 26 | <h2 align='center'>Usage</h2> |
30 | 27 |
|
31 | 28 | ### Preparation |
32 | 29 |
|
33 | | -Using `moduleRaid` as a module, simply require and execute it somewhere where it will end up as a public facing script on a page that also |
34 | | -includes a Webpack build! |
| 30 | +Using `moduleRaid` as a module, simply require and execute it somewhere where it will end up as a public facing script |
35 | 31 |
|
36 | 32 | ```js |
37 | 33 | const moduleRaid = require('moduleraid') |
@@ -63,23 +59,6 @@ If you call moduleRaid with an optional argument `true`, you will enable debug o |
63 | 59 | 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 |
64 | 60 | be fine! |
65 | 61 |
|
66 | | -<h2 align='center'>How it works</h2> |
67 | | - |
68 | | -There already was a script basically doing the same as `moduleRaid` some months earlier, called [`webcrack`](https://gist.github.com/no-boot-device/cb63762000e606e50690911cac1bcead) (made by [no-boot-device](https://github.com/no-boot-device)), which was rendered obsolute due to structural changes in how you can access Webpack modules from the outside. |
69 | | - |
70 | | -This library is an effort to bring back the ability to inspect all available modules, for debugging or userscript purposes. |
71 | | - |
72 | | -As noted above, Webpack exposes a function `webpackJsonp` containing all the code that has been bundled with Webpack. The function takes three |
73 | | -parameters, all of them being an array. The first two don't seem to really matter, the last one is interesting, it seems to directly return |
74 | | -a module given an index. |
75 | | - |
76 | | -So, in a brute-forcy manner we simply run a `while` over `webpackJsonp([], [], [i])` until we get an exception from Webpack (trying to run `call` |
77 | | -on `undefined`), and now we have all modules (_or most of them_)! |
78 | | - |
79 | | -<h2 align='center'>Known Issues</h2> |
80 | | - |
81 | | -* There seem to be a lot of empty modules, I'm not sure if these are _padding_ or something is missing here |
82 | | - |
83 | 62 | <h2 align='center'>License</h2> |
84 | 63 |
|
85 | | -moduleRaid is licensed under the MIT License |
| 64 | +moduleRaid is licensed under the MIT License |
0 commit comments