Greasy Fork is available in English.

Hook.js

Javascript function hook

Этот скрипт недоступен для установки пользователем. Он является библиотекой, которая подключается к другим скриптам мета-ключом // @require https://update.greasyfork.org/scripts/443030/1037826/Hookjs.js

Автор
invobzvr
Версия
0.1
Создан
09.04.2022
Обновлён
09.04.2022
Лицензия
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] }));
    },
});