Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Hierdie gesprek is in die argief. Vra asseblief 'n nuwe vraag as jy hulp nodig het.

browser.places.importHTML is creating Invalid preferences.js

  • 6 antwoorde
  • 1 het hierdie probleem
  • 18 views
  • Laaste antwoord deur Joeri_Rotthier

more options

I've been looking for a scripted way to import 1 extra bookmark from a HTML file.

What I tried was putting following commands into user.js in the appdata folder under the correct profile. made sure it was saved in UTF8. user_pref("browser.bookmarks.file", "C:\\bookmarks.html"); user_pref("browser.places.importBookmarksHTML", True);

The bookmarks.html is placed under the c: drive directly, have tried changing the path to make sure that wasn't the issue. user.js refuses to import those lines.

If I change prefs.js directly, It works on some computers, on most it is like "browser.places.importBookmarksHTML" does not exist. Immediatly creates an InvalidPrefs.js file.

I've tried everything my tiny brain can think of. Any suggestions?

I've been looking for a scripted way to import 1 extra bookmark from a HTML file. What I tried was putting following commands into user.js in the appdata folder under the correct profile. made sure it was saved in UTF8. user_pref("browser.bookmarks.file", "C:\\bookmarks.html"); user_pref("browser.places.importBookmarksHTML", True); The bookmarks.html is placed under the c: drive directly, have tried changing the path to make sure that wasn't the issue. user.js refuses to import those lines. If I change prefs.js directly, It works on some computers, on most it is like "browser.places.importBookmarksHTML" does not exist. Immediatly creates an InvalidPrefs.js file. I've tried everything my tiny brain can think of. Any suggestions?

Gekose oplossing

See also:

Try to use a lowercase 'true'

  • user_pref("browser.places.importBookmarksHTML", true);

You can check the Browser Console ("3-bar" menu button or Tools > Web Developer) for error messages about importing the bookmarks.html file.

Lees dié antwoord in konteks 👍 0

All Replies (6)

more options

Where did you come up with this preference? "browser.places.importBookmarksHTML"

I am not familiar with that pref and can't find any reference to it Developer documentation. https://developer.mozilla.org/en-US/

more options

I found the info through a colleague, http://kb.mozillazine.org/Browser.places.importBookmarksHTML

it seemed the least intrusive way to place a bookmark for all our users.

more options

Sorry, I don't have any suggestion about how to accomplish that.


http://kb.mozillazine.org/Browser.places.importBookmarksHTML OK, I see that pref that was created back in May 2007, a year before Firefox 3.0 was released. I forgot to look at the MozillaZine KB for those prefs. I never used that pref and am not familiar with it. I'm not sure what that pref was intended to do or if that pref is still valid now. You could see if it still works by placing a bookmarks.html file in the Profile folder, but I don't think it will work as you want it to work as I think it was intended for when a new Profile would be created to "import" the default bookmarks.html file. Like early prep work towards the 'new' places.sqlite storage of bookmarks. And since in Firefox 43 or 44 the "default bookmarks" come from somewhere other than a bookmarks.html file sitting in the Profile folder, I wonder whether that pref still may work; but I wouldn't count on it.

http://kb.mozillazine.org/Browser.bookmarks.file That's an old preference that was used in Firefox 2.0 and earlier versions, when bookmarks were stored in bookmarks.html format. As I recall, that pref was intended to move the bookmarks.html file out of the Profile folder, to allow the user to have bookmarks stored elsewhere; I used it frequently so I could use the same bookmarks.html file in multiple Profiles, and using that file from my data storage drive. Not really intended to be used in the manner that you are trying to use it, for picking up 'new' bookmarks. Firefox 3.0 brought a new storage system in sqlite format = places.sqlite, which basically invalidated that preference, at least for the primary storage location of the users bookmarks. There were many 'heated' discussions in forum threads and in Bug reports about a 'new' pref to allow users to move the bookmarks storage file [places.sqlite] out of the Profile folder to have parity with Firefox 2.0 and earlier versions, as was provided by this pref, but the developers nixed that idea due to worries about data corruption. So basically that pref died with the advent of places.sqlite coming to Firefox 3.0' although that pref may have some use for "exporting" to a bookmarks.html file upon closing Firefox and that file being saved to a location outside of the Profile folder. I used it myself for that purpose thru the Firefox 3.0, 3.5, & 3.6 versions; i.e., a "backup" of my bookmarks in html format on a remote drive in case the C:/ drive got b0rked. Not sure why I stopped doing that, though.

more options

Gekose oplossing

See also:

Try to use a lowercase 'true'

  • user_pref("browser.places.importBookmarksHTML", true);

You can check the Browser Console ("3-bar" menu button or Tools > Web Developer) for error messages about importing the bookmarks.html file.

more options

Sorry for the late reply, was Out of the office last week, I'll try to delve deeper into the issue this week and get back to you asap. I really appreciate the feedback! Thanks.

more options

The solution was to use a lower case "true", as well as removing the space between the comma and "true". Every other change resulted in the InvalidPrefs.js file.

Thanks a lot for the info!