Skip to content

Instantly share code, notes, and snippets.

@stefanzweifel
Last active March 3, 2020 14:49
Show Gist options
  • Save stefanzweifel/f8da28761d41bcc4c253c2cd3ac50f60 to your computer and use it in GitHub Desktop.
Save stefanzweifel/f8da28761d41bcc4c253c2cd3ac50f60 to your computer and use it in GitHub Desktop.
Quick and dirty hack to get a list of all domains hosted on Forge. Run it in your browser console. You still have to manually remove the server name strings.
let domains = Array.from($('.nav-item')[1].children[1].children);
let domainList = domains.map(function (item) {
return item.textContent.replace(/(\r\n|\n|\r)/gm, "").trim();
});
console.table(domainList);
@barryvdh
Copy link

barryvdh commented Mar 3, 2020

You can split on space and filter the defaults:

let domains = Array.from($('.nav-item')[1].children[1].children);
let domainList = domains.map(function (item) {
    return item.textContent.replace(/(\r\n|\n|\r)/gm, "").trim().split(' ')[0];
}).filter(domain => domain !== 'default');

console.table(domainList);

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