From 27aa67889fb62353f009ed0275f9388037bed027 Mon Sep 17 00:00:00 2001 From: zino Date: Thu, 30 Sep 2021 14:57:49 +0200 Subject: [PATCH 1/2] added coupon code box inject dependency --- client/src/inject.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/client/src/inject.ts b/client/src/inject.ts index 6201188..f574f5d 100644 --- a/client/src/inject.ts +++ b/client/src/inject.ts @@ -19,14 +19,15 @@ window.addEventListener('load', () => { Utils.consoleLog(inputsWithValue); Utils.consoleLog(`trxstate: ${inputsWithValue["trxstate"]}`); - // "posturl" in function showMap() only available if "pvmapse" PVO code is true. - // "pvmapse" false disables seatmap + // "posturl" in function showMap() only available if "pvmapse" is true, false disables seatmap const posturlAvail: boolean = /posturl:"(.+?)"/.test(content); - + const couponCodeBoxAvail: boolean = !!jQuery("#coupon_code_box").length; + + Utils.consoleLog(`couponCodeBoxAvail: ${couponCodeBoxAvail}`); Utils.consoleLog(`posturl available: ${posturlAvail}`); // Only inject on page with trxstate 20 and if seatmap is enabled with PVO code "pvmapse" - if (inputsWithValue["trxstate"] !== "20" || posturlAvail === false) + if (inputsWithValue["trxstate"] !== "20" || posturlAvail === false || couponCodeBoxAvail === true) return; // Inject parent CSS From 468f0a46b0a9a109ce1f4a07827d28dbf74b1ef7 Mon Sep 17 00:00:00 2001 From: zino Date: Thu, 30 Sep 2021 16:07:41 +0200 Subject: [PATCH 2/2] added coupon successfull message to prevent inject --- client/src/inject.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/src/inject.ts b/client/src/inject.ts index f574f5d..c2a52d5 100644 --- a/client/src/inject.ts +++ b/client/src/inject.ts @@ -15,6 +15,7 @@ window.addEventListener('load', () => { // Parse (hidden) inputs and their values const content: string = new XMLSerializer().serializeToString(document); inputsWithValue = { ...inputsWithValue, ...Parser.getInputs(content) }; + if (jQuery("#get_flash").length) jQuery("#get_flash").hide(); Utils.consoleLog(inputsWithValue); Utils.consoleLog(`trxstate: ${inputsWithValue["trxstate"]}`); @@ -22,12 +23,13 @@ window.addEventListener('load', () => { // "posturl" in function showMap() only available if "pvmapse" is true, false disables seatmap const posturlAvail: boolean = /posturl:"(.+?)"/.test(content); const couponCodeBoxAvail: boolean = !!jQuery("#coupon_code_box").length; - + const couponSuccessfull: boolean = !!jQuery("#coupon_successful").length; + Utils.consoleLog(`couponCodeBoxAvail: ${couponCodeBoxAvail}`); Utils.consoleLog(`posturl available: ${posturlAvail}`); // Only inject on page with trxstate 20 and if seatmap is enabled with PVO code "pvmapse" - if (inputsWithValue["trxstate"] !== "20" || posturlAvail === false || couponCodeBoxAvail === true) + if (inputsWithValue["trxstate"] !== "20" || posturlAvail === false || couponCodeBoxAvail === true || couponSuccessfull === true) return; // Inject parent CSS