From 70d3a54215c02ea28041e9e1d75f16d4edd9765e Mon Sep 17 00:00:00 2001 From: Adrian Vollmer Date: Sun, 18 Feb 2024 21:08:07 +0100 Subject: [PATCH] Monkeypatch more functions used by Sphinx This also monkeypatches `URLSearchParams.delete` and `window.history`. --- zundler/assets/inject_pre.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/zundler/assets/inject_pre.js b/zundler/assets/inject_pre.js index df5dd53..998c360 100644 --- a/zundler/assets/inject_pre.js +++ b/zundler/assets/inject_pre.js @@ -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;