From e30fc01ba474aad2e149829b7b54cc2e4c41c6c3 Mon Sep 17 00:00:00 2001 From: srgooglo Date: Fri, 9 Sep 2022 16:57:48 +0200 Subject: [PATCH] pass all args --- src/client/bridge.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client/bridge.js b/src/client/bridge.js index bf634be..dcda38f 100644 --- a/src/client/bridge.js +++ b/src/client/bridge.js @@ -84,25 +84,25 @@ module.exports = class Bridge { }) } - handleRequestContext = async () => { + handleRequestContext = async (...args) => { if (typeof this.params.onRequest === "function") { - return await this.params.onRequest() + return await this.params.onRequest(...args) } return false } - handleResponse = async (response) => { + handleResponse = async (...args) => { if (typeof this.params.onResponse === "function") { - return await this.params.onResponse(response) + return await this.params.onResponse(...args) } return false } - handleBeforeRequest = async (request) => { + handleBeforeRequest = async (...args) => { if (typeof this.params.onBeforeRequest === "function") { - return await this.params.onBeforeRequest(request) + return await this.params.onBeforeRequest(...args) } return false