X
Tap here to go to the mobile version of the site.

ஆதரவு மன்றம்

String format in about:config for Top Sites with labels

  • 3 replies
  • 1 இந்த பிரச்சனை உள்ளது
  • Last reply by jscher2000
பதிவிடப்பட்டது

I would like to pin some sites to Top Sites via mozilla.cfg. I have mozilla.cfg file, every changes and modifications works as expected, but after adding browser.newtabpage.pinned string copied from about:config, loading of mozilla.cfg end up with syntax error. The line in mozilla.cfg looks like this:

lockPref("browser.newtabpage.pinned", "[{"url":"https://1.site1.de/","label":"S1","baseDomain":"site1.de"},{"url":"https://2.site2.com/","label":"S2","baseDomain":"site2.com"},{"url":"https://3.site3.fr/index.pl","label":"S3"}]");

I don't know, where to add quotes and where/which brackets.

I would like to pin some sites to Top Sites via mozilla.cfg. I have mozilla.cfg file, every changes and modifications works as expected, but after adding browser.newtabpage.pinned string copied from about:config, loading of mozilla.cfg end up with syntax error. The line in mozilla.cfg looks like this: lockPref("browser.newtabpage.pinned", "[{"url":"https://1.site1.de/","label":"S1","baseDomain":"site1.de"},{"url":"https://2.site2.com/","label":"S2","baseDomain":"site2.com"},{"url":"https://3.site3.fr/index.pl","label":"S3"}]"); I don't know, where to add quotes and where/which brackets.

தீர்வு தேர்ந்தெடுக்கப்பட்டது

This issue is because you are enclosing quotes inside of quotes. Firefox doesn't know where one quote begins and the other ends.

For example, in the code that you have provided, Firefox sees "[{" as one quote and ":" as the second thing side of the quotes.

Instead, you will went to enclose the second part of the lockPref with a single quote ( ' ) instead. This way Firefox will open up the quote and assume that everything after that quote a string until it sees the next ' in your code.

Basically, your code should be, instead:

lockPref("browser.newtabpage.pinned", '[{"url":"https://1.site1.de/","label":"S1","baseDomain":"site1.de"},{"url":"https://2.site2.com/","label":"S2","baseDomain":"site2.com"},{"url":"https://3.site3.fr/index.pl","label":"S3"}]');

Hope this helps.

Read this answer in context 1

Additional System Details

நிறுவப்பட்ட நிரல்கள்

  • Shockwave Flash 32.0 r0

பயன்பாடு

  • User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0

கூடுதல் தகவல்

Wesley Branton
  • Top 10 Contributor
703 தீர்வுகள் 5588 பதில்கள்
பதிவிடப்பட்டது

தீர்வு தேர்ந்தெடுக்கப்பட்டது

This issue is because you are enclosing quotes inside of quotes. Firefox doesn't know where one quote begins and the other ends.

For example, in the code that you have provided, Firefox sees "[{" as one quote and ":" as the second thing side of the quotes.

Instead, you will went to enclose the second part of the lockPref with a single quote ( ' ) instead. This way Firefox will open up the quote and assume that everything after that quote a string until it sees the next ' in your code.

Basically, your code should be, instead:

lockPref("browser.newtabpage.pinned", '[{"url":"https://1.site1.de/","label":"S1","baseDomain":"site1.de"},{"url":"https://2.site2.com/","label":"S2","baseDomain":"site2.com"},{"url":"https://3.site3.fr/index.pl","label":"S3"}]');

Hope this helps.

This issue is because you are enclosing quotes inside of quotes. Firefox doesn't know where one quote begins and the other ends. For example, in the code that you have provided, Firefox sees "[{" as one quote and ":" as the second thing side of the quotes. Instead, you will went to enclose the second part of the lockPref with a single quote ( ' ) instead. This way Firefox will open up the quote and assume that everything after that quote a string until it sees the next ' in your code. Basically, your code should be, instead: <pre>lockPref("browser.newtabpage.pinned", '[{"url":"https://1.site1.de/","label":"S1","baseDomain":"site1.de"},{"url":"https://2.site2.com/","label":"S2","baseDomain":"site2.com"},{"url":"https://3.site3.fr/index.pl","label":"S3"}]');</pre> Hope this helps.
cor-el
  • Top 10 Contributor
  • Moderator
17764 தீர்வுகள் 160655 பதில்கள்
பதிவிடப்பட்டது

உதவிகரமான பதில்

You need to escape all quotes inside the JSON string (\").

lockPref("browser.newtabpage.pinned", "[{\"url\":\"https://1.site1.de/\",\"label\":\"S1\",\"baseDomain\":\"site1.de\"},{\"url\":\"https://2.site2.com/\",\"label\":\"S2\",\"baseDomain\":\"site2.com\"},{\"url\":\"https://3.site3.fr/index.pl\",\"label\":\"S3\"}]");
You need to escape all quotes inside the JSON string (\"). <pre><nowiki>lockPref("browser.newtabpage.pinned", "[{\"url\":\"https://1.site1.de/\",\"label\":\"S1\",\"baseDomain\":\"site1.de\"},{\"url\":\"https://2.site2.com/\",\"label\":\"S2\",\"baseDomain\":\"site2.com\"},{\"url\":\"https://3.site3.fr/index.pl\",\"label\":\"S3\"}]");</nowiki></pre>
jscher2000
  • Top 10 Contributor
8878 தீர்வுகள் 72633 பதில்கள்
பதிவிடப்பட்டது

(Deleted duplicate suggestion)

(Deleted duplicate suggestion)

jscher2000 மூலமாக திருத்தப்பட்டது