Coder Social home page Coder Social logo

Comments (6)

Kakadu avatar Kakadu commented on June 7, 2024

@nodiscc We can make a stronger change that splits user.js into categories and allows to override settings in per-category manner. The final user.js will be constructed from partial settings and custom 'override' scripts via Makefile. I made it for myself, diff of Makefile looks like this:

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 += [email protected])
+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

from user.js.

nodiscc avatar nodiscc commented on June 7, 2024

splits user.js into categories

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?

from user.js.

Kakadu avatar Kakadu commented on June 7, 2024

It will not work as some settings could fit in multiple categories. Keep it simple.

I don't see a problem. It can easily support master setting and relaxed settings on top of them.

from user.js.

pyllyukko avatar pyllyukko commented on June 7, 2024

@pyllyukko would you accept a patch adding what I described?

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 relaxed if we do it the same way).

The custom.js (or whatever it will be called) should also be added to gitignore.

from user.js.

nodiscc avatar nodiscc commented on June 7, 2024

I have been experimenting with the proposed custom.js system, a limitation is that it does not allow you to disable/remove prefs that were set in the main user.js. For example I use this in my current config:

// PREF: Disable Service Workers (disabled)
//user_pref("dom.serviceWorkers.enabled",				false); 

It does not override the uncommented, user_pref("dom.serviceWorkers.enabled", false); value in the original user.js when loaded into Firefox.

I don't want to set it explicitly to true, just use Firefox defaults for this pref.

I will keep looking

from user.js.

nodiscc avatar nodiscc commented on June 7, 2024

I am no longer working on this.

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.

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 git merge from time to time to merge upstream changes to my fork (I also maintain a Debian package for it at https://nodiscc.gitlab.io/toolbox/).

from user.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.