Greasy Fork is available in English.

Hook.js

Javascript function hook

Ezt a szkriptet nem ajánlott közvetlenül telepíteni. Ez egy könyvtár más szkriptek számára, amik tartalmazzák a // @require https://update.greasyfork.org/scripts/443030/1037826/Hookjs.js hivatkozást.

Fejlesztő
invobzvr
Verzió
0.1
Létrehozva
2022.04.09.
Frissítve
2022.04.09.
Licensz
GPL-3.0

Hook.js

Description

Javascript function hook

Example

fetch.hook(function () {
    if (arguments[0].endsWith('/log')) {
        return new Response('{"error":0,"data":"ok"}');
    }
});
History.prototype.pushState.hook({
    scope: History.prototype,
    before: function () {
        dispatchEvent(new CustomEvent('pushstate', { detail: arguments[2] }));
    },
});