-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Best way to keep user.js up to date, when you also have modifications? #505
Comments
@nodiscc We can make a stronger change that splits user.js into categories and allows to override settings in per-category manner. The final diff --git a/Makefile b/Makefile
index ec68613..05918bc 100644
--- a/Makefile
+++ b/Makefile
@@ -118,3 +118,42 @@ toc:
anchor=$$(echo "$$line" | tr '[:upper:]' '[:lower:]' | sed 's/ /-/g' | sed 's/\?//g'); \
echo "* [$$line](#$$anchor)"; \
done
+
+.PHONY: user.js
+USER2_FILES=
+define PART_RULES
+.PHONY: u.$(1)
+u.$(1):
+ $$(eval USER2_FILES += $$@.js)
+user.js: u.$(1)
+endef
+PARTS=
+#PARTS=header html5 misc extensions antifeatures autoconn caching ui cryptography cypher_suites css crandel
+PARTS+=header
+PARTS+=html5
+PARTS+=misc
+PARTS+=misc.override
+PARTS+=extensions
+PARTS+=antifeatures
+PARTS+=autoconn
+#PARTS+=caching
+PARTS+=ui
+PARTS+=ui.override
+PARTS+=cryptography
+PARTS+=cypher_suites
+PARTS+=css
+PARTS+=crandel
+
+$(foreach i,$(PARTS),$(eval $(call PART_RULES,$(i)) ) )
+#$(info $(USER2_FILES))
+
+user.js:
+ echo "" > $@
+ for number in $(USER2_FILES); do \
+ if test -f $$number; then \
+ cat $$number >> $@; \
+ echo "" >> $@; \
+ else \
+ printf "Copying of $$number \x1b[1;31mskipped\x1b[0m\n"; \
+ fi \
+ done
|
It will not work as some settings could fit in multiple categories. Keep it simple. @pyllyukko would you accept a patch adding what I described? |
I don't see a problem. It can easily support |
Sounds good. This is also unintrusive in such a way, that if you don't have/want any customizations you can keep using it as usual and nothing breaks. So it would be an additional helper for those who needed it (any maybe The |
I have been experimenting with the proposed // PREF: Disable Service Workers (disabled)
//user_pref("dom.serviceWorkers.enabled", false); It does not override the uncommented, I don't want to set it explicitly to I will keep looking |
I am no longer working on this.
I no longer see this as a problem. I have been maintaining https://github.com/nodiscc/user.js for many years with some modifications [1] on top of pllyukko/user.js, using |
Also discussed in #502, #482
Current way, using git
git checkout -b mymodifications
)git checkout master; git pull
), and merge the updates to your custom branch (git checkout mymodifications; git merge master
)But this requires some knowledge of git, and the history tends to get quite unreadable over time (unless you also know how to use
git rebase
). Another disadvantage is that your custom branch needs manual maintenance/regular merging and sometimes conflict resolution.Proposed solution
To make maintenance of custom configurations easier (or relaxed/altered versions like the
relaxed
branch of this repo), we could concatenate acustom.js
file to the baseuser.js
(easily automatable using the Makefile andcat
). For example:Customizing user.js
To make updates easier through a simple
git pull
or download of the newest file, it is not recommended to write your changes directly touser.js
. Instead, createcustom.js
:make
from the user.js directoryfinal_user.js
is created containing the base settings + your overrides.final_user.js
touser.js
in your profile directoryuser.js
to make it simpler, but then we have to rename the base file)If a preference appears both in the base file, and your custom file, your custom value will take precedence when loaded by Firefox.
If you don't have
make
available, manually concatenateuser.js
andcustom.js
in a text editor, and save the result to asuser.js
in your profile directory.Advantages
relaxed
branch changes to an example custom file in the main branchcustom.js
Disadvantages
The text was updated successfully, but these errors were encountered: