2

I would like to know if there is a way to automatically import bookmarks into the Firefox browser from the bookmarks.html file (the one that can be exported from the browser). That is, I want to skip the step of actually going into the browser's menu and import the file manually from there.

Could a .bat file be created to do this? And if so, what code would it contain?

Thanks in advance.

schmimona
  • 849
  • 3
  • 20
  • 40

2 Answers2

1

5 years too late I'm sure, but if anyone is spending hours and hours researching like myself, here is the solution I found using a Mac (not sure about Windows).

You have to create a file in:

/Applications/Firefox.app/Contents/Resources/defaults/pref/

I named this file all.js. Ideally you want it to begin with a letter close to a, and the contents of this file need to be

pref("general.config.obscure_value", 0);

pref("general.config.filename","mozilla.cfg");

Now that you've made that, you need to make your mozilla.cfg file which should be located at

/Applications/Firefox.app/Contents/Resources/mozilla.cfg  

and the contents of this file should be

// Set desired homepage
pref("browser.startup.homepage", "http://desired.homepage.net/");

// tell firefox to import bookmarks
pref("browser.places.importBookmarksHTML", true);

// location to import from
pref("browser.bookmarks.file", "/Applications/Firefox.app/Contents/Bookmarks.html");

//
pref("browser.bookmarks.restore_default_bookmarks", false);

//true or false, depending if you want it to ask for firefox to be default or not
pref("browser.shell.checkDefaultBrowser", false);

// enables the individual user to add personal bookmarks
lockPref("browser.bookmarks.autoExportHTML", true);

now you can add more preferences you want to regulate by typing about:config in the url bar of firefox.

lastly you want to make sure you have your bookmarks.html file located at:

/Applications/Firefox.app/Contents/Bookmarks.html
Marcucciboy2
  • 3,156
  • 3
  • 20
  • 38
lwaskie
  • 77
  • 1
  • 1
  • 12
1

You can access the bookmarks DB as it's a SQLite DB. But you will need more than a simple CMD application for that.


On the same topic :

Community
  • 1
  • 1
Colin Hebert
  • 91,525
  • 15
  • 160
  • 151