lock_pref(); in /defaults/pref doesn't lock Topic is solved

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
Aalexeey

lock_pref(); in /defaults/pref doesn't lock

Unread post by Aalexeey » 2018-08-09, 16:58

To lock flash player plugin in "click-to-play" mode file flash-click-to-play.js:

Code: Select all

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

lock_pref("plugin.state.flash", 1);
was created in /usr/lib/palemoon/defaults/pref but user_prefs are editable, pref() works fine. How to lock?

Aalexeey

lock_pref(); lockPref(); in /defaults/pref doesn't lock

Unread post by Aalexeey » 2018-08-10, 05:14

lockPref(); doesn't lock too.
Last edited by Aalexeey on 2018-08-10, 05:15, edited 1 time in total.

Aalexeey

[Solved] lockPref(); in /defaults/pref doesn't lock

Unread post by Aalexeey » 2018-08-10, 06:10

In /usr/lib/palemoon/defaults/pref/local-settings.js:

Code: Select all

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

pref("general.config.filename", "mozilla.cfg");
pref("general.config.obscure_value", 0); // use this to disable the byte-shift
In /usr/lib/palemoon/mozilla.cfg:

Code: Select all

//

lockPref("plugin.state.flash", 1);
To Palemoonize settings:
In /usr/lib/palemoon/defaults/pref/local-settings.js:

Code: Select all

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

pref("general.config.filename", "palemoon.cfg");
pref("general.config.obscure_value", 0); // use this to disable the byte-shift
In /usr/lib/palemoon/palemoon.cfg:

Code: Select all

//

lockPref("plugin.state.flash", 1);
How to mark the topic as [Solved] etc. here, first post (yesterday) not editable any more?
Last edited by Aalexeey on 2018-08-10, 07:00, edited 2 times in total.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35475
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: lock_pref(); in /defaults/pref doesn't lock

Unread post by Moonchild » 2018-08-10, 07:43

Off-topic:
You can mark a topic solved with the checkmark button.
For others finding this thread: There's a distinct difference between a preferences file and a configuration file. They may look the same at the surface or at first glance, but they are not. Mozilla config files are not just read, they are executed, meaning you can do a lot more with it than just setting prefs -- lockPref() is something that can only be used in executed js.

Mike Kaply has given some great writeups on his blog about using these files, the background of them and specifics for leveraging the config files in terms of available extensions to the preference handling and other executed js. I suggest you look it up if you want to know more.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Aalexeey

Re: lock_pref(); in /defaults/pref doesn't lock

Unread post by Aalexeey » 2018-08-10, 08:04

Thanks for info!
Moonchild wrote:
Off-topic:
You can mark a topic solved with the checkmark button.
I can't see/find such button (do you mean that right botton with confusing name), maybe Disconnect or AdNauseam are the reason?
Last edited by Aalexeey on 2018-08-10, 08:44, edited 3 times in total.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35475
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: lock_pref(); in /defaults/pref doesn't lock

Unread post by Moonchild » 2018-08-10, 08:12

Off-topic:
The button is on the individual messages (next to info/quote/etc).
Attachments
Image1.png
Image1.png (5.16 KiB) Viewed 412 times
Last edited by Moonchild on 2018-08-10, 08:14, edited 2 times in total.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Aalexeey

Re: lock_pref(); in /defaults/pref doesn't lock

Unread post by Aalexeey » 2018-08-10, 08:25

O.K. thanks, the name of that button :crazy:

Locked