-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathff.js
More file actions
55 lines (39 loc) · 1.56 KB
/
ff.js
File metadata and controls
55 lines (39 loc) · 1.56 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
const FirefoxProfile = require('firefox-profile');
const createProfile = require('./lib/create-firefox-profile');
const fs = require('fs');
const path = require('path');
const ProfileFinder = new FirefoxProfile.Finder();
ProfileFinder.readProfiles(() => {
const profilesDir = `${ProfileFinder.directory}/Profiles`;
const newProfile = `${profilesDir}/tmp`;
createProfile({profile: newProfile}, (err, folder) => {
if (err) throw err;
console.log(folder)
})
});
// ─────────────────────────────────────────────────────────────────────────────
// console.log('AppDataPath:', AppDataPath)
// FirefoxProfile.copyFromUserProfile({name: 'test-ext-user'}, function(err, profile) {
// console.log(profile.profileDir);
// // profile.shouldDeleteOnExit(false);
// });
// const tempy = require('tempy')
// const fs = require('fs')
// const path = require('path')
// const prefs = {
// 'browser.shell.checkDefaultBrowser': false
// }
// if (opts.prefs) {
// for (let key of Object.keys(opts.prefs)) {
// if (opts.prefs[key] != null) {
// prefs[key] = JSON.stringify(opts.prefs[key])
// }
// }
// }
// const profile = Object.keys(prefs)
// .reduce((acc, key) => `${acc}user_pref('${key}', ${prefs[key]});\n`, '')
// const profileFolder = tempy.directory()
// fs.writeFile(path.join(profileFolder, 'user.js'), profile, (err) => {
// if (err) return callback(err)
// callback(null, profileFolder)
// })