PKGBUILD 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  1. # Maintainer (Arch:firefox): Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
  2. # Contributor (Arch:firefox): Ionut Biru <ibiru@archlinux.org>
  3. # Contributor (Arch:firefox): Jakub Schmidtke <sjakub@gmail.com>
  4. # Contributor (ConnochaetOS): Henry Jensen <hjensen@connochaetos.org>
  5. # Maintainer: Andreas Grapentin <andreas@grapentin.org>
  6. # Maintainer: Luke Shumaker <lukeshu@parabola.nu>
  7. # Contributor: André Silva <emulatorman@hyperbola.info>
  8. # Contributor: Márcio Silva <coadde@hyperbola.info>
  9. # Contributor: fauno <fauno@kiwwwi.com.ar>
  10. # Contributor: vando <facundo@esdebian.org>
  11. # Contributor: Figue <ffigue at gmail>
  12. # Contributor: taro-k <taro-k@movasense_com>
  13. # Contributor: Michał Masłowski <mtjm@mtjm.eu>
  14. # Contributor: Luke R. <g4jc@openmailbox.org>
  15. # Contributor: Isaac David <isacdaavid@isacdaavid.info>
  16. # Contributor: bill-auger <bill-auger@programmer.net>
  17. # Contributor: evr <evanroman at gmail>
  18. # Contributor: Muhammad 'MJ' Jassim <UnbreakableMJ@gmail.com>
  19. # Rational for inclusion in [libre]:
  20. # - Modify the addons pages to use GNU IceCat plugins sources, rather
  21. # than addons.mozilla.org, which hosts non-free addons.
  22. # - Disable EME, which is implemented via the non-free libWideVine
  23. # CDM.
  24. #
  25. # The above changes cause us to run afoul of the Firefox trademark
  26. # policy[1], so making those changes also requires us to:
  27. # - Rebrand to Iceweasel
  28. #
  29. # While we're at it, while not strictly nescessary for FSDG
  30. # compliance:
  31. # - Remove Google API keys and usage
  32. # - Disable Mozilla telemetry and crash reporting (good manners
  33. # because of all of the other patching we're doing
  34. #
  35. # [1]: https://www.mozilla.org/en-US/foundation/trademarks/policy/
  36. #
  37. # IMPORTANT NOTICE:
  38. # libremakepkg *will* choke on this package, unless sufficient space is
  39. # provided in /tmp.
  40. #
  41. # currently, at least 4.2MiB are required.
  42. pkgname=iceweasel
  43. replaces=('firefox')
  44. epoch=1
  45. pkgver=65.0.1
  46. pkgrel=1
  47. pkgrel+=.parabola1.testing1
  48. _brandingver=${pkgver%.*}
  49. _brandingrel=1
  50. pkgdesc="Libre standalone web browser based on Mozilla Firefox"
  51. arch=(x86_64)
  52. arch+=(i686 armv7h)
  53. license=(MPL GPL LGPL)
  54. url="https://wiki.parabola.nu/$pkgname"
  55. depends=(gtk3 mozilla-common libxt startup-notification mime-types dbus-glib
  56. ffmpeg nss ttf-font libpulse sqlite libvpx icu)
  57. makedepends=(unzip zip diffutils python2-setuptools yasm mesa imake inetutils
  58. xorg-server-xvfb autoconf2.13 rust mercurial clang llvm jack gtk2
  59. python nodejs python2-psutil cbindgen nasm)
  60. makedepends+=(mozilla-searchplugins quilt libxslt imagemagick)
  61. optdepends=('networkmanager: Location detection via available WiFi networks'
  62. 'libnotify: Notification integration'
  63. 'pulseaudio: Audio support'
  64. 'speech-dispatcher: Text-to-Speech'
  65. 'hunspell-en_US: Spell checking, American English')
  66. options=(!emptydirs !makeflags !debug)
  67. _repo=https://hg.mozilla.org/mozilla-unified
  68. source=("hg+$_repo#tag=FIREFOX_${pkgver//./_}_RELEASE"
  69. $pkgname.desktop)
  70. source+=(https://repo.parabola.nu/other/iceweasel/${pkgname}_${_brandingver}-${_brandingrel}.branding.tar.xz{,.sig}
  71. libre-searchengines.patch
  72. libre.patch)
  73. sha256sums=('SKIP'
  74. 'ed350ef2f528b999a621f7080fa80948be6b351e67ce32529fb32bcf47bb21fa'
  75. '4e4d52addfb0de4b4439e959e5c35194e35a6840a21dcf6b20c46604ae7f6482'
  76. 'SKIP'
  77. '871222c88dfd240b1805b28c98ca7431bd2b87be1ff4dbb06caa6407b106b803'
  78. '4a4667d99ab50b1990de6833e9647ddd428d9206e422c7cc3754d4f80aeb8038')
  79. validpgpkeys+=('BFA8008A8265677063B11BF47171986E4B745536') # Andreas Grapentin
  80. prepare() {
  81. mkdir mozbuild
  82. cd mozilla-unified
  83. cat >.mozconfig <<END
  84. ac_add_options --enable-application=browser
  85. ac_add_options --prefix=/usr
  86. ac_add_options --enable-release
  87. ac_add_options --enable-linker=gold
  88. ac_add_options --enable-hardening
  89. ac_add_options --enable-optimize
  90. ac_add_options --enable-rust-simd
  91. ac_add_options --enable-lto
  92. export MOZ_PGO=1
  93. export CC=clang
  94. export CXX=clang++
  95. export AR=llvm-ar
  96. export NM=llvm-nm
  97. export RANLIB=llvm-ranlib
  98. # Branding
  99. ac_add_options --disable-official-branding
  100. ac_add_options --with-branding=browser/branding/iceweasel
  101. ac_add_options --enable-update-channel=release
  102. ac_add_options --with-distribution-id=nu.parabola
  103. # System libraries
  104. ac_add_options --enable-system-ffi
  105. ac_add_options --enable-system-sqlite
  106. ac_add_options --with-system-bz2
  107. ac_add_options --with-system-icu
  108. ac_add_options --with-system-jpeg
  109. ac_add_options --with-system-libvpx
  110. ac_add_options --with-system-nspr
  111. ac_add_options --with-system-nss
  112. ac_add_options --with-system-zlib
  113. # Features
  114. ac_add_options --enable-alsa
  115. ac_add_options --enable-jack
  116. ac_add_options --enable-startup-notification
  117. ac_add_options --disable-crashreporter
  118. ac_add_options --disable-gconf
  119. ac_add_options --disable-updater
  120. ac_add_options --disable-eme
  121. END
  122. if [[ $CARCH = arm* ]]; then
  123. sed -i '/--enable-linker=gold/d' .mozconfig
  124. cat >> .mozconfig <<- END
  125. ac_add_options --enable-optimize="-g -O2 -fno-schedule-insns"
  126. END
  127. fi # end [[ $CARCH = arm* ]]
  128. if [[ $CARCH = i686 ]]; then
  129. sed -i '/--enable-linker=gold/d' .mozconfig
  130. fi # Because gold linker is alergic to some of the compile options set below to limit memory use.
  131. ## Rebranding
  132. local brandingdir="$srcdir/$pkgname-$_brandingver"
  133. rm -rf -- browser/branding/$pkgname
  134. cp -aT -- $brandingdir/branding browser/branding/$pkgname
  135. # patching
  136. export QUILT_PATCHES=$brandingdir/patches
  137. export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
  138. export QUILT_DIFF_ARGS='--no-timestamps'
  139. quilt push -av
  140. # Put "Start Page" branding images in the source code
  141. #install -m644 -t browser/base/content/abouthome -- \
  142. # "$brandingdir/branding"/{drm-free,gnu_headshadow,parabola-banner}.png
  143. #install -m644 -t browser/extensions/onboarding/content/img -- \
  144. # "$brandingdir/branding/watermark.svg"
  145. # produce icons
  146. for i in 16 22 24 32 48 64 128 192 256 384; do
  147. rsvg-convert -w $i -h $i "$brandingdir/branding/${pkgname}_icon.svg" \
  148. -o "browser/branding/iceweasel/default$i.png"
  149. done
  150. # Remove remaining non-free bits
  151. patch -Np1 -i "$srcdir/libre.patch"
  152. #sed -i 's/Adobe Flash/SWF Player/g' -- \
  153. # browser/base/content/pageinfo/permissions.js \
  154. # browser/base/content/browser-plugins.js
  155. #sed -e '/"displayName": "Flash"/ s/Flash/SWF Player/' \
  156. # -e '/"displayName": "Shockwave"/ s/Shockwave/DCR Player/' \
  157. # -e '/"displayName": "QuickTime"/ s/QuickTime/MOV Player/' \
  158. # -e '/installLinux/ s/true/false/' \
  159. # -i -- browser/base/content/browser-plugins.js
  160. # re-use 'abouthome' page for 'newtab' page
  161. #install -d browser/base/content/newtab
  162. #cat browser/base/content/abouthome/aboutHome.xhtml > browser/base/content/newtab/newTab.xhtml
  163. # Load our searchplugins
  164. patch -Np1 -i "$srcdir/libre-searchengines.patch"
  165. rm -rvf -- browser/components/search/searchplugins/{*.xml,images/}
  166. cp -av -- /usr/lib/mozilla/searchplugins/* browser/components/search/searchplugins/
  167. # Disable various components at the source level
  168. sed -i 's/;1/;0/' toolkit/components/telemetry/TelemetryStartup.manifest
  169. #sed -i 's/;1/;0/' browser/experiments/Experiments.manifest
  170. #sed -i '/pocket/d' browser/extensions/moz.build
  171. #sed -i '/activity-stream/d' browser/extensions/moz.build
  172. }
  173. build() {
  174. cd mozilla-unified
  175. export MOZ_SOURCE_REPO="$_repo"
  176. export MOZ_NOSPAM=1
  177. export MOZBUILD_STATE_PATH="$srcdir/mozbuild"
  178. if [[ $CARCH = i686 ]]; then
  179. export RUSTFLAGS+=" -Cdebuginfo=0 -Clto=off"
  180. export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
  181. echo "Fixing x32 memory limits"
  182. fi #Fix Memory issue
  183. # LTO needs more open files
  184. ulimit -n 4096
  185. ./mach build
  186. ./mach buildsymbols
  187. }
  188. package() {
  189. local _icu_ver
  190. _icu_ver=$(pacman -S --print-format='%v' icu)
  191. depends+=("icu>=${_icu_ver}" "icu<$((${_icu_ver%%.*} + 1))")
  192. cd mozilla-unified
  193. DESTDIR="$pkgdir" ./mach install
  194. find . -name '*crashreporter-symbols-full.zip' -exec cp -fvt "$startdir" {} +
  195. _vendorjs="$pkgdir/usr/lib/$pkgname/browser/defaults/preferences/vendor.js"
  196. install -Dm644 /dev/stdin "$_vendorjs" <<END
  197. // Use LANG environment variable to choose locale
  198. pref("intl.locale.requested", "");
  199. // Use system-provided dictionaries
  200. pref("spellchecker.dictionary_path", "/usr/share/hunspell");
  201. // Disable default browser checking.
  202. pref("browser.shell.checkDefaultBrowser", false);
  203. // Don't disable our bundled extensions in the application directory
  204. pref("extensions.autoDisableScopes", 11);
  205. pref("extensions.shownSelectionUI", true);
  206. END
  207. # Parabola additions to vendor.js
  208. #
  209. # TODO: Go through this and figure out what's nescessary, remove
  210. # most of it. This is mostly cargo-cult BS. For example, disabling
  211. # all the EME stuff... that's already off because of `--disable-eme`
  212. # in `.mozconfig`. Some of these settings no longer exist. Some of
  213. # these settings don't do anything on GNU/Linux.
  214. #
  215. # However, they don't seem to be causing any of the critical issues.
  216. local _shortver=$(cut -d. -f1,2 <<<"$pkgver")
  217. cat >> "$_vendorjs" <<END
  218. // Disable "alt" as a shortcut key to open full menu bar. Conflicts with "alt" as a modifier
  219. pref("ui.key.menuAccessKeyFocuses", false);
  220. // Disable the GeoLocation API for content
  221. pref("geo.enabled", false);
  222. // Make sure that the request URL of the GeoLocation backend is empty
  223. pref("geo.wifi.uri", "");
  224. // Disable Freedom Violating DRM Feature
  225. pref("browser.eme.ui.enabled", false);
  226. // EME
  227. pref("media.eme.enabled", false);
  228. pref("media.eme.apiVisible", false);
  229. // Google Widevine DRM
  230. // https://blog.mozilla.org/futurereleases/2016/04/08/mozilla-to-test-widevine-cdm-in-firefox-nightly/
  231. // https://wiki.mozilla.org/QA/Widevine_CDM
  232. // https://bugzilla.mozilla.org/show_bug.cgi?id=1288580
  233. pref("media.gmp-widevinecdm.visible", false);
  234. pref("media.gmp-widevinecdm.enabled", false);
  235. pref("media.gmp-widevinecdm.autoupdate", false);
  236. // Default to classic view for about:newtab
  237. pref("browser.newtabpage.enhanced", false);
  238. pref("browser.newtabpage.activity-stream.enabled", false);
  239. // Poodle attack
  240. pref("security.tls.version.min", 1);
  241. // Don't call home for blacklisting
  242. pref("extensions.blocklist.enabled", false);
  243. // Disable plugin installer
  244. pref("plugins.hide_infobar_for_missing_plugin", true);
  245. pref("plugins.hide_infobar_for_outdated_plugin", true);
  246. pref("plugins.notifyMissingFlash", false);
  247. //https://developer.mozilla.org/en-US/docs/Web/API/MediaSource
  248. //pref("media.mediasource.enabled",true);
  249. // Speeding it up
  250. pref("network.http.pipelining", true);
  251. pref("network.http.proxy.pipelining", true);
  252. pref("network.http.pipelining.maxrequests", 10);
  253. pref("nglayout.initialpaint.delay", 0);
  254. // Disable third party cookies
  255. pref("network.cookie.cookieBehavior", 1);
  256. // Prevent EULA dialog to popup on first run
  257. pref("browser.EULA.override", true);
  258. // Set useragent to Firefox compatible
  259. //pref("general.useragent.compatMode.firefox", true);
  260. // Spoof the useragent to a generic one
  261. pref("general.useragent.compatMode.firefox", true);
  262. // Spoof the useragent to a generic one
  263. pref("general.useragent.override", "Mozilla/5.0 (Windows NT 6.1; rv:$_shortver) Gecko/20100101 Firefox/$_shortver");
  264. pref("general.appname.override", "Netscape");
  265. pref("general.appversion.override", "$_shortver");
  266. pref("general.buildID.override", "Gecko/20100101");
  267. pref("general.oscpu.override", "Windows NT 6.1");
  268. pref("general.platform.override", "Win32");
  269. // Privacy & Freedom Issues
  270. // https://webdevelopmentaid.wordpress.com/2013/10/21/customize-privacy-settings-in-mozilla-firefox-part-1-aboutconfig/
  271. // https://panopticlick.eff.org
  272. // http://ip-check.info
  273. // http://browserspy.dk
  274. // https://wiki.mozilla.org/Fingerprinting
  275. // http://www.browserleaks.com
  276. // http://fingerprint.pet-portal.eu
  277. pref("privacy.donottrackheader.enabled", true);
  278. pref("privacy.donottrackheader.value", 1);
  279. pref("dom.ipc.plugins.flash.subprocess.crashreporter.enabled", false);
  280. // CIS 2.1.1 Disable Auto Update / Balrog
  281. pref("app.update.auto", false);
  282. pref("app.update.checkInstallTime", false);
  283. pref("app.update.enabled", false);
  284. pref("app.update.staging.enabled", false);
  285. pref("app.update.url", "about:blank");
  286. pref("media.gmp-manager.certs.1.commonName", "");
  287. pref("media.gmp-manager.certs.2.commonName", "");
  288. // Disable Gecko media plugins: https://wiki.mozilla.org/GeckoMediaPlugins
  289. pref("media.gmp-manager.url", "http://127.0.0.1/");
  290. pref("media.gmp-manager.url.override", "data:text/plain,");
  291. pref("media.gmp-provider.enabled", false);
  292. // Don't install openh264 codec
  293. pref("media.gmp-gmpopenh264.enabled", false);
  294. pref("media.gmp-eme-adobe.enabled", false);
  295. pref("media.peerconnection.video.h264_enabled", false);
  296. // CIS 2.3.4 Block Reported Web Forgeries
  297. // http://kb.mozillazine.org/Browser.safebrowsing.enabled
  298. // http://kb.mozillazine.org/Safe_browsing
  299. // https://support.mozilla.org/en-US/kb/how-does-phishing-and-malware-protection-work
  300. // http://forums.mozillazine.org/viewtopic.php?f=39&t=2711237&p=12896849#p12896849
  301. pref("browser.safebrowsing.enabled", false);
  302. // CIS 2.3.5 Block Reported Attack Sites
  303. // http://kb.mozillazine.org/Browser.safebrowsing.malware.enabled
  304. pref("browser.safebrowsing.malware.enabled", false);
  305. // Disable safe browsing remote lookups for downloaded files.
  306. // This leaks information to google.
  307. // https://www.mozilla.org/en-US/firefox/39.0/releasenotes/
  308. // https://wiki.mozilla.org/Security/Application_Reputation
  309. pref("browser.safebrowsing.downloads.remote.enabled", false);
  310. pref("browser.safebrowsing.appRepURL", "about:blank");
  311. pref("browser.safebrowsing.provider.mozilla.gethashURL", "about:blank");
  312. pref("browser.safebrowsing.provider.mozilla.updateURL", "about:blank");
  313. pref("browser.safebrowsing.downloads.remote.block_dangerous", false);
  314. pref("browser.safebrowsing.downloads.remote.block_dangerous_host", false);
  315. pref("browser.safebrowsing.downloads.remote.block_potentially_unwanted", false);
  316. pref("browser.safebrowsing.downloads.remote.block_uncommon", false);
  317. pref("browser.safebrowsing.downloads.remote.enabled", false);
  318. pref("browser.safebrowsing.downloads.remote.url", "about:blank");
  319. pref("browser.safebrowsing.provider.google.gethashURL", "about:blank");
  320. pref("browser.safebrowsing.provider.google.updateURL", "about:blank");
  321. pref("browser.safebrowsing.provider.google.lists", "about:blank");
  322. // https://bugzilla.mozilla.org/show_bug.cgi?id=1025965
  323. pref("browser.safebrowsing.phishing.enabled", false);
  324. pref("browser.safebrowsing.provider.google4.lists", "about:blank");
  325. pref("browser.safebrowsing.provider.google4.updateURL", "about:blank");
  326. pref("browser.safebrowsing.provider.google4.gethashURL", "about:blank");
  327. pref("browser.safebrowsing.provider.google4.reportURL", "about:blank");
  328. pref("browser.safebrowsing.provider.mozilla.lists", "about:blank");
  329. // Disable Microsoft Family Safety MiTM support
  330. // https://bugzilla.mozilla.org/show_bug.cgi?id=1239166
  331. // https://wiki.mozilla.org/SecurityEngineering/Untrusted_Certificates_in_Windows_Child_Mode
  332. // https://hg.mozilla.org/releases/mozilla-release/file/ddb37c386bb2ffa180117b4d30ca3b41a8af233c/security/manager/ssl/nsNSSComponent.cpp#l782
  333. pref("security.family_safety.mode", 0);
  334. // https://bugzilla.mozilla.org/show_bug.cgi?id=1265113
  335. // https://hg.mozilla.org/releases/mozilla-release/rev/d9659c22b3c5
  336. // https://bugzilla.mozilla.org/show_bug.cgi?id=1298883
  337. pref("security.enterprise_roots.enabled", false);
  338. //pref("services.sync.privacyURL", "https://www.gnu.org/software/gnuzilla/");
  339. pref("social.enabled", false);
  340. pref("social.remote-install.enabled", false);
  341. pref("datareporting.healthreport.uploadEnabled", false);
  342. pref("datareporting.healthreport.about.reportUrl", "127.0.0.1");
  343. pref("datareporting.healthreport.documentServerURI", "127.0.0.1");
  344. pref("healthreport.uploadEnabled", false);
  345. pref("social.toast-notifications.enabled", false);
  346. pref("datareporting.policy.dataSubmissionEnabled", false);
  347. pref("datareporting.healthreport.service.enabled", false);
  348. pref("browser.slowStartup.notificationDisabled", true);
  349. pref("network.http.sendRefererHeader", 2);
  350. //pref("network.http.referer.spoofSource", true);
  351. //http://grack.com/blog/2010/01/06/3rd-party-cookies-dom-storage-and-privacy/
  352. //pref("dom.storage.enabled", false);
  353. pref("dom.event.clipboardevents.enabled",false);
  354. pref("network.prefetch-next", false);
  355. pref("network.dns.disablePrefetch", true);
  356. pref("network.http.sendSecureXSiteReferrer", false);
  357. pref("toolkit.telemetry.archive.enabled", false);
  358. pref("toolkit.telemetry.bhrPing.enabled", false);
  359. pref("toolkit.telemetry.enabled", false);
  360. pref("toolkit.telemetry.unified", false);
  361. pref("toolkit.telemetry.newProfilePing.enabled", false);
  362. pref("toolkit.telemetry.firstShutdownPing.enabled", false);
  363. pref("toolkit.telemetry.server", "127.0.0.1");
  364. pref("app.shield.optoutstudies.enabled", false);
  365. pref("experiments.enabled", false);
  366. pref("experiments.manifest.uri", "127.0.0.1");
  367. pref("extensions.pocket.enabled", false);
  368. pref("extensions.pocket.api", "127.0.0.1");
  369. // Do not tell what plugins do we have enabled: https://mail.mozilla.org/pipermail/firefox-dev/2013-November/001186.html
  370. pref("plugins.enumerable_names", "");
  371. pref("plugin.state.flash", 0);
  372. // Do not autoupdate search engines
  373. pref("browser.search.update", false);
  374. // Warn when the page tries to redirect or refresh
  375. //pref("accessibility.blockautorefresh", true);
  376. pref("dom.battery.enabled", false);
  377. pref("device.sensors.enabled", false);
  378. pref("camera.control.face_detection.enabled", false);
  379. pref("camera.control.autofocus_moving_callback.enabled", false);
  380. pref("network.http.speculative-parallel-limit", 0);
  381. // No search suggestions
  382. pref("browser.urlbar.userMadeSearchSuggestionsChoice", true);
  383. pref("browser.search.suggest.enabled", false);
  384. // Crypto hardening
  385. // https://gist.github.com/haasn/69e19fc2fe0e25f3cff5
  386. // General settings
  387. //pref("security.tls.unrestricted_rc4_fallback", false);
  388. //pref("security.tls.insecure_fallback_hosts.use_static_list", false);
  389. //pref("security.tls.version.min", 1);
  390. //pref("security.ssl.require_safe_negotiation", true);
  391. //pref("security.ssl.treat_unsafe_negotiation_as_broken", true);
  392. //pref("security.ssl3.rsa_seed_sha", true);
  393. //pref("security.OCSP.enabled", 1);
  394. //pref("security.OCSP.require", true);
  395. // WebRTC
  396. pref("media.peerconnection.enabled", false);
  397. pref("media.peerconnection.ice.default_address_only", true);
  398. pref("font.default.x-western", "sans-serif");
  399. // Preferences for the Get Add-ons panel and search engines
  400. pref("extensions.webservice.discoverURL", "https://directory.fsf.org/wiki/GNU_IceCat");
  401. pref("extensions.getAddons.search.url", "https://directory.fsf.org/wiki/GNU_IceCat");
  402. pref("browser.search.searchEnginesURL", "https://directory.fsf.org/wiki/GNU_IceCat");
  403. // Mobile
  404. pref("privacy.announcements.enabled", false);
  405. pref("browser.snippets.enabled", false);
  406. pref("browser.snippets.syncPromo.enabled", false);
  407. pref("identity.mobilepromo.android", "https://f-droid.org/repository/browse/?fdid=org.gnu.icecat&");
  408. pref("browser.snippets.geoUrl", "http://127.0.0.1/");
  409. pref("browser.snippets.updateUrl", "http://127.0.0.1/");
  410. pref("browser.snippets.statsUrl", "http://127.0.0.1/");
  411. pref("datareporting.policy.firstRunTime", 0);
  412. pref("datareporting.policy.dataSubmissionPolicyVersion", 2);
  413. pref("browser.webapps.checkForUpdates", 0);
  414. pref("browser.webapps.updateCheckUrl", "http://127.0.0.1/");
  415. pref("app.faqURL", "http://libreplanet.org/wiki/Group:IceCat/FAQ");
  416. // PFS url
  417. pref("pfs.datasource.url", "http://gnuzilla.gnu.org/plugins/PluginFinderService.php?mimetype=%PLUGIN_MIMETYPE%");
  418. pref("pfs.filehint.url", "http://gnuzilla.gnu.org/plugins/PluginFinderService.php?mimetype=%PLUGIN_MIMETYPE%");
  419. // Geolocation depends on third party services
  420. pref("geo.enabled", false);
  421. pref("geo.wifi.uri", "");
  422. // Disable heartbeat
  423. pref("browser.selfsupport.url", "");
  424. // Disable Link to FireFox Marketplace, currently loaded with non-free "apps"
  425. pref("browser.apps.URL", "");
  426. // Use old style preferences, that allow javascript to be disabled
  427. pref("browser.preferences.inContent",false);
  428. // Don't download ads for the newtab page
  429. pref("browser.newtabpage.directory.source", "");
  430. pref("browser.newtabpage.directory.ping", "");
  431. pref("browser.newtabpage.introShown", true);
  432. // Disable home snippets
  433. pref("browser.aboutHomeSnippets.updateUrl", "data:text/html");
  434. // Disable hardware acceleration and WebGL
  435. //pref("layers.acceleration.disabled", false);
  436. pref("webgl.disabled", false);
  437. // Disable SSDP
  438. pref("browser.casting.enabled", false);
  439. // Disable directory service
  440. pref("social.directories", "");
  441. pref("social.whitelist", "");
  442. pref("social.shareDirectory", "");
  443. // Disable Pocket integration
  444. pref("browser.pocket.api", "about:blank");
  445. pref("browser.pocket.enabled", false);
  446. pref("browser.pocket.enabledLocales", "about:blank");
  447. pref("browser.pocket.oAuthConsumerKey", "about:blank");
  448. pref("browser.pocket.site", "about:blank");
  449. pref("browser.pocket.useLocaleList", false);
  450. pref("extensions.pocket.enabled", false);
  451. // Do not require xpi extensions to be signed by Mozilla
  452. pref("xpinstall.signatures.required", false);
  453. // Disable File and Directory Entries API (Imported from Edge/Chromium)
  454. // https://developer.mozilla.org/en-US/Firefox/Releases/50#Files_and_directories
  455. // https://developer.mozilla.org/en-US/docs/Web/API/File_and_Directory_Entries_API
  456. // https://developer.mozilla.org/en-US/docs/Web/API/File_and_Directory_Entries_API/Introduction
  457. // https://developer.mozilla.org/en-US/docs/Web/API/File_and_Directory_Entries_API/Firefox_support
  458. // https://bugzilla.mozilla.org/show_bug.cgi?id=1265767
  459. pref("dom.webkitBlink.filesystem.enabled", false);
  460. // https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory
  461. // https://bugzilla.mozilla.org/show_bug.cgi?id=1258489
  462. // https://hg.mozilla.org/releases/mozilla-release/rev/133af19777be
  463. pref("dom.webkitBlink.dirPicker.enabled", false);
  464. // Directory Upload API, webkitdirectory
  465. // https://bugzilla.mozilla.org/show_bug.cgi?id=1188880
  466. // https://bugzilla.mozilla.org/show_bug.cgi?id=907707
  467. // https://wicg.github.io/directory-upload/proposal.html
  468. pref("dom.input.dirpicker", false);
  469. // fix alsa sound sandbox issue for iceweasel-58
  470. // https://labs.parabola.nu/issues/1628
  471. pref("security.sandbox.content.syscall_whitelist", "16");
  472. END
  473. _distini="$pkgdir/usr/lib/$pkgname/distribution/distribution.ini"
  474. install -Dm644 /dev/stdin "$_distini" <<END
  475. [Global]
  476. id=parabola
  477. version=1.0
  478. about=Parabola Iceweasel for Parabola GNU/Linux-libre
  479. [Preferences]
  480. app.distributor=parabola
  481. app.distributor.channel=$pkgname
  482. app.partner.parabola=parabola
  483. END
  484. for i in 16 22 24 32 48 64 128 192 256 384; do
  485. install -Dm644 browser/branding/$pkgname/default$i.png \
  486. "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/$pkgname.png"
  487. done
  488. install -Dm644 "browser/branding/$pkgname/${pkgname}_icon.svg" \
  489. "$pkgdir/usr/share/icons/hicolor/scalable/apps/$pkgname.svg"
  490. install -Dm644 ../$pkgname.desktop \
  491. "$pkgdir/usr/share/applications/$pkgname.desktop"
  492. # Install a wrapper to avoid confusion about binary path
  493. install -Dm755 /dev/stdin "$pkgdir/usr/bin/$pkgname" <<END
  494. #!/bin/sh
  495. exec /usr/lib/$pkgname/$pkgname "\$@"
  496. END
  497. # Replace duplicate binary with wrapper
  498. # https://bugzilla.mozilla.org/show_bug.cgi?id=658850
  499. ln -srf "$pkgdir/usr/bin/$pkgname" \
  500. "$pkgdir/usr/lib/$pkgname/$pkgname-bin"
  501. }