Open KaKi87 opened 2 years ago
What website are you trying to run moduleRaid on?
If webpackJsonp
is not available in window
you need to specify a custom entrypoint (e.g. https://moduleraid.netlify.app/classes/moduleraid.moduleraid#constructor)
What website are you trying to run moduleRaid on?
On chat2.kaki87.net, which is my own fosscord instance.
More precisely, I'd like to remove the DoB fieldset, which is easy, except the form won't submit, which means I also need to access the React component and set a default value (e.g. 1970-01-01
) to unblock it.
If
webpackJsonp
is not available inwindow
you need to specify a custom entrypoint (e.g. https://moduleraid.netlify.app/classes/moduleraid.moduleraid#constructor)
I saw that, which isn't necessary in this case.
Thanks !
Hmm, if I run the script on the page via the console it works fine.
I don't know how you are implementing moduleRaid but maybe you are too early then (moduleRaid tries to call the entrypoint as a function as the last resort, which was some legacy Webpack bundling way)
I don't know how you are implementing moduleRaid
Using the following code :
{
const script = document.createElement('script');
script.setAttribute('src', 'https://unpkg.com/moduleraid/dist/moduleraid.iife.js');
script.addEventListener('load', () => window.mR = new ModuleRaid());
document.head.appendChild(script);
}
but maybe you are too early then
Would waiting for DOMContentLoaded
be enough ?
moduleRaid tries to call the entrypoint as a function as the last resort
What does it uses first then ?
Thanks
I got the same error while trying on whatsapp client before login.
Yeah, I saw the errors prop up a bit more often in other projects too.
I'll see about fixing that injection method, so it doesn't throw errors anymore at least.
Yeah, I saw the errors prop up a bit more often in other projects too.
I'll see about fixing that injection method, so it doesn't throw errors anymore at least.
Hi! Any news?
Okay, so an update on this:
First, I have made new releases since:
6.0.1 fixed an issue with function method injections, these should work again (important for Webpack v3 and earlier).
6.1.0 introduces a new feature: Entrypoint detection :tada:
In case of WhatsApp Web, the entrypoint isn't called webpackJsonp
but webpackChunkwhatsapp_web_client
and moduleRaid now will try it's best to automatically detect an endpoint if webpackJsonp
is not the correct one.
You can now also specify a strict
option in the constructor, where detection is not run, and if your specified entrypoint (or by default webpackJsonp
) is not found, you will get an error.
I also fixed the final brute-force injection method so that it doesn't say window[this.entrypoint] is not a function
, but it will actually return Unknown Webpack structure
instead.
This hopefully should solve most of the issues from this thread!
Hello,
I am getting the following error when calling
new ModuleRaid()
:Thanks