Skip to content

Patcher Api

GL.patcher

Methods

after()

after(id, object, method, callback): () => void

Runs a callback after a function on an object has been run

Parameters

ParameterType
idstring
objectany
methodstring
callback(thisVal, args, returnVal) => any

Returns

Function

A function to remove the patch

Returns

void


before()

before(id, object, method, callback): () => void

Runs a callback before a function on an object has been run. Return true from the callback to prevent the function from running

Parameters

ParameterType
idstring
objectany
methodstring
callback(thisVal, args) => boolean | void

Returns

Function

A function to remove the patch

Returns

void


instead()

instead(id, object, method, callback): () => void

Runs a function instead of a function on an object

Parameters

ParameterType
idstring
objectany
methodstring
callback(thisVal, args) => void

Returns

Function

A function to remove the patch

Returns

void


unpatchAll()

unpatchAll(id): void

Removes all patches with a given id

Parameters

ParameterType
idstring

Returns

void