Last active
October 21, 2020 19:34
-
-
Save mkhamat/13d02174ee4151a396354451ed58a273 to your computer and use it in GitHub Desktop.
Firefox User.js Generator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This is script for https://gist.github.com/0XDE57/fbd302cef7693e62c769 | |
* remove descriptions and leave only config lines! | |
* put it in txt file and pass path to it through arg | |
* example: node index.js ./config.txt | |
* | |
* user.js will appear in the same directory | |
* | |
*/ | |
const fs = require('fs'); | |
var config = ``; | |
fs.readFile(process.argv[2], 'utf-8', (err, data) => { | |
let arr = data.split(/\n/) | |
for (let i = 0; i < arr.length; i++) { | |
let setting = arr[i].trim().split('=')[0] | |
let value = arr[i].trim().split('=')[1] | |
config += `user_pref("${setting}", ${value});\n`; | |
} | |
fs.writeFile('./user.js', config, 'utf-8') | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment