forked from kkoooqq/fakebrowser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo2-diff-fp2.js
33 lines (27 loc) · 1.05 KB
/
demo2-diff-fp2.js
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
28
29
30
31
32
33
const {FakeBrowser} = require('fakebrowser');
!(async () => {
const createBrowserAndGoto = async (dd, userDataDir, url) => {
const builder = new FakeBrowser.Builder()
.deviceDescriptor(dd)
.vanillaLaunchOptions({
headless: false,
})
.userDataDir(userDataDir);
const fakeBrowser = await builder.launch();
const page = await fakeBrowser.vanillaBrowser.newPage();
await page.goto(url);
// ***** Do something automatic *****
// Don't forget to close your browser to release resources
await fakeBrowser.shutdown();
};
createBrowserAndGoto(
require('./node_modules/fakebrowser/device-hub-demo/Windows.json'),
'./fakeBrowserUserData3',
'https://fingerprintjs.github.io/fingerprintjs/',
).then(e => e);
createBrowserAndGoto(
require('./node_modules/fakebrowser/device-hub-demo/macOS.json'),
'./fakeBrowserUserData4',
'https://fingerprintjs.github.io/fingerprintjs/',
).then(e => e);
})();