added coupon successfull message to prevent inject

This commit is contained in:
zino
2021-09-30 16:07:41 +02:00
parent 27aa67889f
commit 468f0a46b0

View File

@@ -15,6 +15,7 @@ window.addEventListener('load', () => {
// Parse (hidden) inputs and their values // Parse (hidden) inputs and their values
const content: string = new XMLSerializer().serializeToString(document); const content: string = new XMLSerializer().serializeToString(document);
inputsWithValue = { ...inputsWithValue, ...Parser.getInputs(content) }; inputsWithValue = { ...inputsWithValue, ...Parser.getInputs(content) };
if (jQuery("#get_flash").length) jQuery("#get_flash").hide();
Utils.consoleLog(inputsWithValue); Utils.consoleLog(inputsWithValue);
Utils.consoleLog(`trxstate: ${inputsWithValue["trxstate"]}`); 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 // "posturl" in function showMap() only available if "pvmapse" is true, false disables seatmap
const posturlAvail: boolean = /posturl:"(.+?)"/.test(content); const posturlAvail: boolean = /posturl:"(.+?)"/.test(content);
const couponCodeBoxAvail: boolean = !!jQuery("#coupon_code_box").length; const couponCodeBoxAvail: boolean = !!jQuery("#coupon_code_box").length;
const couponSuccessfull: boolean = !!jQuery("#coupon_successful").length;
Utils.consoleLog(`couponCodeBoxAvail: ${couponCodeBoxAvail}`); Utils.consoleLog(`couponCodeBoxAvail: ${couponCodeBoxAvail}`);
Utils.consoleLog(`posturl available: ${posturlAvail}`); Utils.consoleLog(`posturl available: ${posturlAvail}`);
// Only inject on page with trxstate 20 and if seatmap is enabled with PVO code "pvmapse" // 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; return;
// Inject parent CSS // Inject parent CSS