Forked from twilight-sparkle-irl/webcrack.discord.min.js
Last active
August 8, 2019 17:53
-
-
Save nightpool/8772a70ca71ffb2e3fefee68a037984a to your computer and use it in GitHub Desktop.
webcrack for tumblr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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']] | |
]); |
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
Some examples: