From b07912a389ee6c98e97be47f96dbb4cafcd41393 Mon Sep 17 00:00:00 2001 From: Birm Date: Thu, 21 Mar 2024 13:03:54 -0400 Subject: [PATCH] extend proxy --- common/util.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/common/util.js b/common/util.js index 770acac1b..d9562a3cb 100644 --- a/common/util.js +++ b/common/util.js @@ -354,9 +354,19 @@ function getUrlVars() { vars[key.toLowerCase()] = value; }); + var state = Object.assign({}, vars); // Copy the initial state from vars + return new Proxy({}, { get: function(target, prop) { - return vars[prop.toLowerCase()]; + return state[prop.toLowerCase()]; + }, + set: function(target, prop, value) { + state[prop.toLowerCase()] = value; + return true; + }, + deleteProperty: function(target, prop) { + delete state[prop.toLowerCase()]; + return true; } }); }