-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.ts
27 lines (21 loc) Β· 805 Bytes
/
app.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import puppeteer from 'puppeteer';
import colors from 'colors/safe';
(async () => {
const args = ['--proxy-server=http://127.0.0.1:8118'];
const browser = await puppeteer.launch({ args });
const page = await browser.newPage();
await page.goto('https://check.torproject.org/');
const isUsingTor = await page.$eval('body', el =>
el.innerHTML.includes('Congratulations. This browser is configured to use Tor')
);
if (!isUsingTor) {
console.log(colors.red('Not using Tor\nClosing...'));
return await browser.close();
}
console.log(colors.green('Using Tor π§
\nContinuing... '));
// Now you can go wherever you want
await page.goto('https://propub3r6espa33w.onion/');
// You would add additional code to do stuff...
// Then when you're done, just close
await browser.close();
})();