Last active
July 23, 2021 01:18
-
-
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
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
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. | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Learn more about Chrome snippets https://developer.chrome.com/docs/devtools/javascript/snippets/