Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] Remove spaces/tabs between preference name and value #332

Closed
bitpixl opened this issue Aug 15, 2017 · 9 comments
Closed

[Suggestion] Remove spaces/tabs between preference name and value #332

bitpixl opened this issue Aug 15, 2017 · 9 comments

Comments

@bitpixl
Copy link

bitpixl commented Aug 15, 2017

So not an issue but more a quality of life improvement for me and hopefully others as well.
I've been using this user.js for a while now and also changed and added some preferences (also non security related prefs) because I'm using some online services that require changes to your user.js.

For me (and hopefully others) it would make it alot easier if the values don't have tabs/spaces between the preferences (example:) user_pref("security.ssl3.dhe_dss_camellia_256_sha",false); because it would allow me to do quick replace actions for the complete lines (including the value).

Now I can't because the space seems to differ between preferences and their values (even when I look on this site) and it seems when I download the file the formatting also differs when I'm looking at it on Notepad++.

Hope you consider it and keep up the great work!

@savyajha
Copy link

As a counterpoint, having those spaces/tabs helps in readability. Would it not be better merely proposing that there be say, 12 spaces between the comma and the value of the key for all keys?

@bitpixl
Copy link
Author

bitpixl commented Aug 16, 2017

For that I would suggest using Notepad++. It automatically assigns the comments/prefs and values a different color and thereby greatly improves the readability of the the whole user.js file. But having a fixed amount of spaces would also be a solution that I could work with.

@pyllyukko
Copy link
Owner

Related issue: #243

@pyllyukko
Copy link
Owner

It is indeed because of the readability. I like to have the values aligned.

For me (and hopefully others) it would make it alot easier if the values don't have tabs/spaces between the preferences (example:) user_pref("security.ssl3.dhe_dss_camellia_256_sha",false); because it would allow me to do quick replace actions for the complete lines (including the value).

I don't understand. How does it help? Replacing should be easy enough anyway.

@bitpixl
Copy link
Author

bitpixl commented Aug 17, 2017

Hey Pyllyukko, yeah I figured that was the intention and it's great that everything seems perfectly alligned on your terminal screen, but sadly it's not the case on my end and looking at issue #243 it seems I'm not the only one.

For me (and hopefully others) it would make it alot easier if the values don't have tabs/spaces between the preferences (example:) user_pref("security.ssl3.dhe_dss_camellia_256_sha",false); because it would allow me to do quick replace actions for the complete lines (including the value).

If there isn't a space between the pref and value OR a fixed amount of spaces I can create a script that searches for that specific pref with value and then modifies it to the value I need for certain web services.
That way I can simply always download the lastest user.js from here, add my stuff (and change a couple of yours) using a script and be done with it. Hope that makes sense.

It would make it easier to always use your User.js as the baseline script.

update: OR is there someway to create another .js script that always overrules user.js? That way I would be able to put my custom changes in that.

@pyllyukko
Copy link
Owner

If there isn't a space between the pref and value OR a fixed amount of spaces I can create a script that searches for that specific pref with value and then modifies it to the value I need for certain web services.
That way I can simply always download the lastest user.js from here, add my stuff (and change a couple of yours) using a script and be done with it. Hope that makes sense.

Isn't that what regular expressions are for? :) e.g.: sed -i '/^user_pref("security.ssl3.dhe_dss_camellia_256_sha"/s/^\(.\+",\s\+\).\+\();\)$/\1true\2/' user.js

I would like to come up with a proper clang-format config that would take care of all of this. But with the alignment :)

@bitpixl
Copy link
Author

bitpixl commented Aug 17, 2017

Looking at your regular expression I have the feeling I just got schooled :)
Yes, you're right, I'm just "rusty" (read:n00b) with regular expressions.

@Thorin-Oakenpants
Copy link

@bitpixl

update: OR is there someway to create another .js script that always overrules user.js? That way I would be able to put my custom changes in that.

Either add a section at the end of the user.js - because it is parsed in order, so anything listed twice, the last instance is the one that is applied (but would mean you need to copypasta it back in all the time .. boring!)

.. or ... [even better]

use a /profile/preferences//override.js - explained in more detail here .. this way you can just re-apply the user.js from here, no fuss and restart FF - no need to muck around with re-tweaking

Read the link, there are caveats

@bitpixl
Copy link
Author

bitpixl commented Aug 18, 2017

.. or ... [even better]

Yes! now I can just download this user.js and add my own custom settings. Thanks for the info/links :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants