Skip to content

Instantly share code, notes, and snippets.

@vdeturckheim

vdeturckheim/injector_evaluate_4.js Secret

Last active Jan 21, 2021
Embed
What would you like to do?
await client.Runtime.evaluate({
expression:"process.patchListeners = require(`./toInject.js`).patchListeners",
includeCommandLineAPI: true,
returnByValue: false
});
// in the injected function, the value for `this` will be the instance of the server
await client.Runtime.callFunctionOn({
objectId: serverInstance,
functionDeclaration: 'function() { process.patchListeners(this) }',
returnByValue: true
});
await client.Runtime.evaluate({
expression:"delete process.patchListeners",
includeCommandLineAPI: true,
returnByValue: false
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment