Monkeypatch more functions used by Sphinx

This also monkeypatches `URLSearchParams.delete`
and `window.history`.
This commit is contained in:
Adrian Vollmer 2024-02-18 21:08:07 +01:00
parent 2b870da3cb
commit 70d3a54215

View File

@ -30,10 +30,20 @@ var myGet = function (arg) {
}
};
var myDelete = function (arg) {};
URLSearchParams.prototype.get = myGet;
URLSearchParams.prototype.delete = myDelete;
/*
* Monkeypatch fetch
* Monkeypatch window.history
*/
var myReplaceState = function (arg1, arg2, arg3) {};
window.history.replaceState = myReplaceState;
/*
* Monkeypatch window.fetch
*/
const { fetch: originalFetch } = window;