Skip to content

Instantly share code, notes, and snippets.

@marklchaves
Last active July 23, 2021 01:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marklchaves/2ad3e8421bcf737e627532bde8850728 to your computer and use it in GitHub Desktop.
Save marklchaves/2ad3e8421bcf737e627532bde8850728 to your computer and use it in GitHub Desktop.
Chrome snippet to highlight and console.log all Popup Maker and custom popup triggers
console.clear();
let allTriggers = [...$$(".pum-trigger"), ...$$("[class*='launch']")]; // Replace launch with your custom trgger if any.
if (allTriggers.length > 0) {
let firstTrigger = "";
let s = allTriggers.length === 1 ? "" : "s";
console.info('[PUM] %d trigger%s found!', allTriggers.length, s);
console.groupCollapsed('[PUM] All triggers');
allTriggers.forEach(t => {
if (!firstTrigger) {
firstTrigger = t;
}
t.style.outline = "3px solid limegreen";
console.dirxml(t);
});
console.groupEnd('[PUM] All triggers');
firstTrigger.scrollIntoView();
} else {
console.info('[PUM] 0 triggers found!');
}
/**
* Using a Chrome snippet in combination with console.log tools allows you to
* get a list of elements that you can quickly inspect in the elements tab,
* highlight on the page on hover, and scroll into view on the page.
*/
@marklchaves
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment