Created
April 10, 2018 18:42
-
-
Save brunokrebs/3f08117db4141d9d72435ae686f72a81 to your computer and use it in GitHub Desktop.
Script to be ran manually. It searches for clients and centralised on pages.
This file contains hidden or 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
let clientLinks = [].slice.call(document.getElementsByTagName('a')).filter(link => { | |
const {href} = link; | |
if (href.indexOf('manage.auth0.com') < 0) return null; | |
if (href.indexOf('clients') > 0) return link; | |
return null; | |
}); | |
function inspectChildren(element) { | |
const children = [].slice.call(element.childNodes); | |
children.forEach(child => { | |
if (child.nodeName !== '#text') return; | |
const {textContent} = child; | |
if (!textContent) return; | |
if (textContent.indexOf('client') >= 0 || | |
textContent.indexOf('Client') >= 0) { | |
importantElements.push(element); | |
} | |
if (textContent.indexOf('centralized') >= 0 || | |
textContent.indexOf('Centralized') >= 0 || | |
textContent.indexOf('centralised') >= 0 || | |
textContent.indexOf('Centralised') >= 0) { | |
if (textContent.indexOf('login') >= 0 || textContent.indexOf('Login') >= 0) { | |
importantElements.push(element); | |
} | |
} | |
}); | |
children.forEach(inspectChildren); | |
} | |
const importantElements = []; | |
inspectChildren(document.body); | |
console.log('\n\n\n'); | |
console.log("###########################################"); | |
if (clientLinks.length > 0) console.log("######### Search for /#/clients"); | |
if (importantElements.length > 0) console.log("######### Search for Client or Centralized"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment