Skip to content

Instantly share code, notes, and snippets.

@brunokrebs
Created April 10, 2018 18:42
Show Gist options
  • Save brunokrebs/3f08117db4141d9d72435ae686f72a81 to your computer and use it in GitHub Desktop.
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.
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