Last active
March 2, 2023 08:45
-
-
Save marklchaves/14ccdbb93872db196dbf298037cc3fc2 to your computer and use it in GitHub Desktop.
Prompt for a popup ID number and then display the trigger settings for that popup ID in a table format.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const popupID = prompt("What's the popup ID number?"); | |
if (typeof PUM !== 'undefined') { | |
let triggers = PUM.getSettings(popupID).triggers[0]; | |
if (typeof triggers !== 'undefined') { | |
console.log(`%cTrigger Settings for Popup ID ${popupID}`, | |
"color: #b92099; font-size: 20px;"); | |
console.table(triggers); // Triggers | |
if (typeof triggers.settings !== 'undefined') { | |
console.table(triggers.settings); // Cookies | |
//console.table(PUM.getSettings(input).triggers[0][1].settings); // Displays cookie name` | |
} | |
} else { | |
console.log(`%cGot nothing. Are you sure "${popupID}" the right popup ID number?`, | |
"color: firebrick; font-size: 18px;"); | |
} | |
} else { | |
console.log('No Popup Maker popups here. Is Popup Maker running on this page?') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment