Skip to content

Instantly share code, notes, and snippets.

@nightpool
Forked from twilight-sparkle-irl/webcrack.discord.min.js
Last active August 8, 2019 17:53
Show Gist options
  • Save nightpool/8772a70ca71ffb2e3fefee68a037984a to your computer and use it in GitHub Desktop.
Save nightpool/8772a70ca71ffb2e3fefee68a037984a to your computer and use it in GitHub Desktop.
webcrack for tumblr
// With acknowledgments to zoe bootsy.
// Copyright 2019, licensed under the GPL v3.0 or later.
const webcrack3_injection = (_module, _exports, require) => {
window.webcrack3 = {
require,
moduleFunctions: require.m,
findModuleFunctionWithSourceLike (string_or_regex) {
const predicate = typeof string_or_regex === "string" ?
s => s.indexOf(string_or_regex) !== -1 :
string_or_regex.test.bind(string_or_regex);
return Object.entries(this.moduleFunctions).
filter((name, func) => predicate(func.toString()));
},
loadedModules: require.c,
findExportedName (key) {
return Object.values(this.loadedModules).
filter(m => m.exports && m.exports[key]).
map(m => m.exports[key]);
}
}
}
(window.webpackJsonp = window.webpackJsonp || []).push([
[1337], {webcrack3_injection}, [['webcrack3_injection']]
]);
@nightpool
Copy link
Author

nightpool commented Aug 4, 2019

Note that after setting $r.props programmatically you have to force the component to re-render, which you can do by calling $r.forceUpdate()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment