ISO icon indicating copy to clipboard operation
ISO copied to clipboard

Preinstall uBlock Origin for Firefox system-wide or bundle with .app

Open probonopd opened this issue 3 years ago • 10 comments

Unfortunately there is no port anymore: https://www.freshports.org/www/xpi-uBlock_origin/

So, something along these lines?

sudo sh
URL=$(wget -c "https://api.github.com/repos/gorhill/uBlock/releases" -O - | grep browser_download_url | grep 'firefox.signed.xpi"' | head -n 1 | cut -d '"' -f 4)\n
wget -c "$URL"
sudo mkdir -p /usr/local/bin/browser/extensions
sudo mv ./*firefox.signed.xpi "/usr/local/lib/firefox/browser/extensions/[email protected]"

probonopd avatar Nov 14 '21 13:11 probonopd

Also would need to disable that privacy-invading crap called telemetry

WARNING: A blocker encountered an error while we were waiting.
          Blocker:  TelemetryController: shutting down
          Phase: profile-before-change-telemetry
          State: {"initialized":false,"initStarted":false,"haveDelayedInitTask":false,"shutdownBarrier":"Not started","connectionsBarrier":"Not started","sendModule":{"sendingEnabled":false,"pendingPingRequestCount":0,"pendingPingActivityCount":0,"unpersistedPingCount":0,"persistedPingCount":0,"schedulerState":{"shutdown":true,"hasSendTask":false,"sendsFailed":false,"sendTaskState":"bail out - no pings to send","backoffDelay":60000}},"haveDelayedNewProfileTask":false,"shutdownStep":"TelemetrySession 4.78475200000139"}
WARNING: [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsITelemetry.msSinceProcessStartExcludingSuspend]"  nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: resource://gre/modules/TelemetrySession.jsm :: getSessionPayload :: line 752"  data: no]
WARNING: getSessionPayload@resource://gre/modules/TelemetrySession.jsm:752:28
saveShutdownPings@resource://gre/modules/TelemetrySession.jsm:956:34
shutdownChromeProcess/cleanup/<@resource://gre/modules/TelemetrySession.jsm:1226:20
cleanup@resource://gre/modules/TelemetrySession.jsm:1233:9
shutdownChromeProcess@resource://gre/modules/TelemetrySession.jsm:1250:14
shutdown@resource://gre/modules/TelemetrySession.jsm:252:17
_cleanupOnShutdown@resource://gre/modules/TelemetryControllerParent.jsm:970:30
observe@resource://gre/modules/AsyncShutdown.jsm:575:16

JavaScript error: resource://gre/modules/TelemetrySession.jsm, line 752: NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsITelemetry.msSinceProcessStartExcludingSuspend]
JavaScript error: resource://gre/modules/TelemetrySession.jsm, line 752: NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsITelemetry.msSinceProcessStartExcludingSuspend]

probonopd avatar Nov 14 '21 13:11 probonopd

A fork of Firefox with no Telemetry and with Ublock Origin https://librewolf-community.gitlab.io/

0hip avatar Nov 14 '21 16:11 0hip

@jsm222 how hard do you think would it be to port over the Firefox global menu patch to Librewolf? Hopefully it applies 1:1. Would you be able to build a pkg for it? That would be tremendous.

Next ISO should have your repo pre-enabled, btw.

probonopd avatar Nov 14 '21 17:11 probonopd

You can give patching of librewolf a go, perhaps start with finishing up the port on bugzilla? https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258503 the unity patches are here https://aur.archlinux.org/packages/firefox-appmenu/ The fix_wayland and unity_*.patch (two patch files) were enough lsdiff from diffutils and git are very usefull..

jsm222 avatar Nov 15 '21 13:11 jsm222

Since I am working on optimizing the Live ISO creation right now, I can't look into LibreWolf at the moment. @0hip if you feel strongly about it maybe you can have a go at it?

probonopd avatar Nov 15 '21 18:11 probonopd

I wish I could but I am a "mere mortal", the kind for what the slimmed version is for :(

0hip avatar Nov 16 '21 02:11 0hip

https://github.com/helloSystem/Applications/releases now has Firefox and Firefox ESR based on the @jsm222 repo but with bundled uBlock Origin.

probonopd avatar Nov 23 '21 13:11 probonopd

We can still consider to preinstall it system-wide...

probonopd avatar Nov 23 '21 13:11 probonopd

Raspberry Pi OS uses /etc/chromium/master_preferences (this string is hardcoded in /usr/lib/chromium-browser/chromium-browser on Debian):

{
	"alternate_error_pages":{
		"enabled":false
	},
	"extensions":{
		"settings":{
			"cjpalhdlnbpafiamejdnhcphjbkeiagm":{
				"location":1,
				"manifest":{
					"manifest_version":2,
					"key":"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmJNzUNVjS6Q1qe0NRqpmfX/oSJdgauSZNdfeb5RV1Hji21vX0TivpP5gq0fadwmvmVCtUpOaNUopgejiUFm/iKHPs0o3x7hyKk/eX0t2QT3OZGdXkPiYpTEC0f0p86SQaLoA2eHaOG4uCGi7sxLJmAXc6IsxGKVklh7cCoLUgWEMnj8ZNG2Y8UKG3gBdrpES5hk7QyFDMraO79NmSlWRNgoJHX6XRoY66oYThFQad8KL8q3pf3Oe8uBLKywohU0ZrDPViWHIszXoE9HEvPTFAbHZ1umINni4W/YVs+fhqHtzRJcaKJtsTaYy+cholu5mAYeTZqtHf6bcwJ8t9i2afwIDAQAB",
					"name":"uBlock Origin",
					"permissions":["contextMenus","privacy","storage","tabs","unlimitedStorage","webNavigation","webRequest","webRequestBlocking","<all_urls>"],
					"update_url":"https://clients2.google.com/service/update2/crx",
					"version":"0.0"
				},
				"granted_permissions":{
					"api":["contextMenus","privacy","storage","tabs","unlimitedStorage","webNavigation","webRequest","webRequestBlocking"],
					"explicit_host":["<all_urls>","chrome://favicon/*","http://*/*","https://*/*"],
					"scriptable_host":["http://*/*","https://*/*"]
				},
				"path":"cjpalhdlnbpafiamejdnhcphjbkeiagm\\0.0",
				"state":1
			},
			"aleakchihdccplidncghkekgioiakgal":{
				"location":1,
				"manifest":{
					"manifest_version":2,
                    "key":"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxpuYJpBArlJinXxN4oxx4UuFNreRTNO5Cl3TNF5FtDmgNLflbtYyC2nC5eZGxpNibzauHmGTD8ekFCfNZhHFpUEIZWd9AHI7TZdhu6gPxaK1lPEMukVEewFs2ovaEkjZbe3gy3v0eUDnADUkiaex7XeAWR6mJLzmcUaPFgzFRsDkozsE9tXLNN6oEYuWHN/yRsM1RYo7PYPulutHF8POL/8vDSyWHx/W9YDTnbv+2SBJZO7Dxi1/PbutasUag+/jma0X1nGhrEufr67NMvtpjPWSISWkIwxPR8u7EVyrKTSXs6U7jCbhKedhomeu9E/xZ1Er0dGWYWnhpdo0GNvblwIDAQAB",
					"name":"h264ify",
					"permissions":["storage"],
					"update_url":"https://clients2.google.com/service/update2/crx",
					"version":"0.0"
				},
				"granted_permissions":{
					"api":["storage"],
					"manifest_permissions":[],
					"scriptable_host":["*://*.youtube.com/*","*://*.youtube-nocookie.com/*","*://*.youtu.be/*"]
				},
				"path":"aleakchihdccplidncghkekgioiakgal\\0.0",
				"state":1
			}
		},
		"theme":{
			"id":"",
			"use_system":true
		}
	},
	"browser":{
		"custom_chrome_frame":false,
		"default_browser_infobar_last_declined":"1"
	},
	"default_search_provider":{
		"synced_guid":"9A111FB4-A8D3-4FDD-84CE-76178E50246B"
	},
	"default_search_provider_data":{
		"template_url_data":{
			"alternate_urls":[],
			"created_by_policy":false,
			"date_created":"13114024949603971",
			"favicon_url":"",
			"id":"7",
			"image_url":"",
			"image_url_post_params":"",
			"input_encodings":[],
			"instant_url":"",
			"instant_url_post_params":"",
			"keyword":"duckduckgo.com",
			"last_modified":"13114024949603971",
			"new_tab_url":"",
			"originating_url":"",
			"prepopulate_id":0,
			"safe_for_autoreplace":false,
			"search_terms_replacement_key":"",
			"search_url_post_params":"",
			"short_name":"DuckDuckGo",
			"suggestions_url":"",
			"suggestions_url_post_params":"",
			"synced_guid":"9A111FB4-A8D3-4FDD-84CE-76178E50246B",
			"url":"https://duckduckgo.com/?q={searchTerms}&t=raspberrypi",
			"usage_count":0
		}
	},
	"search":{
	    "suggest_enabled":false
	},
	"profile":{
	    "default_content_setting_values":{
	        "plugins":0
	    }
	},
	"first_run_tabs":["https://welcome.raspberrypi.com/raspberry-pi-os?id=462c9e58fdbbb8ad87fe7eed15be87740dc7be21606ec5b85d1a13032d8677e8"]
}

Possibly this is a Debian-specific thing. Needs to be investigated.

probonopd avatar Nov 16 '23 19:11 probonopd

Is there a generator or an easy way to generate a master_preferences file for

# I still don't care about cookies
edibdbjcniadpccecjdfdjjppcpchdlm

# uBlock Origin
cjpalhdlnbpafiamejdnhcphjbkeiagm

# SponsorBlock for YouTube
mnjggcdmjocbbbhaepdhchncahnbgone

probonopd avatar Nov 19 '23 18:11 probonopd