Skip to content

Commit

Permalink
Firefox
Browse files Browse the repository at this point in the history
Created a new snowblock that adds support for Firefox (1) and Firefox
Developer Edition (). It includes…

* …the `user.js` (3) file to define and persist almost all preferences
for a profile.
* …the `profiles.ini` (4) file to configure the name and path of the
main profile `igloo`.
* …the `ignore-dev-edition-profile` file to fix Bugzilla bug 1098986 (5)
that causes Firefox Developer Edition to use the internal default
profile regardless of whether another customized profile has been set as
default. The problem can be fixed by creating the file within the
Firefox application data folder.
* …the `chrome` folder with the `userChrome.css` (6) and
`userContent.css` (7) files to change the Firefox's UI components design
and elements within the content.
* …the `containers.json` file of the Firefox Multi-Account Containers
(8) to persist the configured containers.
* …the documentation about the setup, tips & tricks and various
configurations.

More information and additional references:

* pyllyukko/user.js (9) - Firefox `user.js` configuration file for
Mozilla Firefox designed to harden browser settings and make it more
secure.
* ghacksuserjs/ghacks-user.js (10) - An ongoing comprehensive user.js
template for configuring and hardening Firefox privacy, security and
anti-fingerprinting.

References:

  (1) https://www.mozilla.org/en-US/firefox
  (2) https://www.mozilla.org/en-US/firefox/developer
  (3) http://kb.mozillazine.org/User.js_file
  (4) http://kb.mozillazine.org/Profiles.ini_file
  (5) https://bugzilla.mozilla.org/show_bug.cgi?id=1098986
  (6) http://kb.mozillazine.org/index.php?title=UserChrome.css
  (7) http://kb.mozillazine.org/index.php?title=UserContent.css
  (8) https://addons.mozilla.org/en-US/firefox/addon/multi-account-containers
  (9) https://github.com/ghacksuserjs/ghacks-user.js
  (10) https://github.com/pyllyukko/user.js

Closes GH-139
  • Loading branch information
arcticicestudio committed Sep 16, 2018
1 parent 38ec12d commit 505e340
Show file tree
Hide file tree
Showing 10 changed files with 800 additions and 0 deletions.
64 changes: 64 additions & 0 deletions snowblocks/firefox/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Firefox (Developer Edition)

This snowblock for [Firefox][] Quantum and [Firefox Developer Edition][firefox-dev-edition] provides…

* …the [`user.js`][mzkb-user.js] file to define and persist almost all preferences for a profile.
* …the [`profiles.ini`][mzkb-profiles.ini] file to configure the name and path of the main profile `igloo`.
* …the `ignore-dev-edition-profile` file (placed within the Firefox application data folder) to fix [Bugzilla bug 1098986][bugzilla-1098986] that causes Firefox Developer Edition to use the internal default profile regardless of whether another customized profile has been set as default.
* …the `chrome` folder with the [`userChrome.css`][mzkb-userchrome.css] and [`userContent.css`][mzkb-usercontent.css] files to customize the Firefox UI components design and layout and elements of websites.
* …the `containers.json` file of the [Firefox Multi-Account Containers][firefox-addon-multi-acc-cont] to persist the configured containers.

## Configurations

### Typeface

Due to licensing and the availability of specific font families on different operating systems the preferences for the default sans-serif and serif typefaces must be configured manually using the Firefox UI (_Preferences__General__Language and Appearance__Fonts & Colors_ → <kdb>Advanced…</kdb>) or by setting the following keys to the desired font family names:

```js
/* Linux */
user_pref("font.name.sans-serif.x-western", "<FONT FAMILY>"); // e.g. "Roboto"
user_pref("font.name.serif.x-western", "<FONT FAMILY>"); // e.g. "Noto Serif"

/* macOS (default font families) */
user_pref("font.name.sans-serif.x-western", "Helvetica");
user_pref("font.name.serif.x-western", "Times");
```

The default font for the monospace typeface is system independent and has already been set in the [`user.js`][gh-igloo-sb-ff-user.js] to [Source Code Pro][google-font-source-code-pro]:

```js
user_pref("font.name.monospace.x-western", "Source Code Pro");
```

## Troubleshooting

### Ignore the default Firefox Developer Edition profile

Due to a [bug in Firefox Developer Edition][bugzilla-1098986] only the default profile will be used regardless of whether another customized profile has been set as default. The problem has been fixed by creating a [`ignore-dev-edition-profile`][gh-igloo-sb-ff-ignore-dev-profile] file within the Firefox application data folder:

```sh
# Linux
touch ~/.mozilla/firefox/ignore-dev-edition-profile

# macOS
touch ~/Library/Application\ Support/Firefox/ignore-dev-edition-profile
```

## References

* [ghacksuserjs/ghacks-user.js][] - An ongoing comprehensive user.js template for configuring and hardening Firefox privacy, security and anti-fingerprinting.
* [pyllyukko/user.js][] - Firefox `user.js` configuration file for Mozilla Firefox designed to harden browser settings and make it more secure.

[bugzilla-1098986]: https://bugzilla.mozilla.org/show_bug.cgi?id=1098986
[firefox]: https://www.mozilla.org/en-US/firefox
[firefox-addon-multi-acc-cont]: https://addons.mozilla.org/en-US/firefox/addon/multi-account-containers
[firefox-dev-edition]: https://www.mozilla.org/en-US/firefox/developer
[ghacksuserjs/ghacks-user.js]: https://github.com/ghacksuserjs/ghacks-user.js
[gh-igloo-sb-ff-ignore-dev-profile]: https://github.com/arcticicestudio/igloo/blob/develop/snowblocks/firefox/ignore-dev-edition-profile
[gh-igloo-sb-ff-user.js]: https://github.com/arcticicestudio/igloo/blob/develop/snowblocks/firefox/user.js
[google-font-source-code-pro]: https://fonts.google.com/specimen/Source+Code+Pro
[mzkb-profiles.ini]: http://kb.mozillazine.org/Profiles.ini_file
[mzkb-user.js]: http://kb.mozillazine.org/User.js_file
[mzkb-userchrome.css]: http://kb.mozillazine.org/index.php?title=UserChrome.css
[mzkb-usercontent.css]: http://kb.mozillazine.org/index.php?title=UserContent.css
[pyllyukko/user.js]: https://github.com/pyllyukko/user.js
26 changes: 26 additions & 0 deletions snowblocks/firefox/chrome/content/support/extensions/octotree.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (C) 2016-present Arctic Ice Studio <[email protected]>
* Copyright (C) 2016-present Sven Greb <[email protected]>
*
* Project: igloo
* Repository: https://github.com/arcticicestudio/igloo
* License: MIT
*/

/**
* @file Defines rules for the "Octotree" addon/extension.
*
* @see https://github.com/buunguyen/octotree
*/

@-moz-document domain("github.com") {
/*
* Remove the activation and keyboard shortcut popup.
* The state is stored with the `octotree.popup_shown` property stored in the local storage and set to `true` after
* being shown for the first time.
* Anyway, using a private window/session caused it to appear each time for any "github.com" domain.
*/
.octotree_toggle.btn .popup {
display: none;
}
}
14 changes: 14 additions & 0 deletions snowblocks/firefox/chrome/userChrome.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright (C) 2016-present Arctic Ice Studio <[email protected]>
* Copyright (C) 2016-present Sven Greb <[email protected]>
*
* Project: igloo
* Repository: https://github.com/arcticicestudio/igloo
* License: MIT
*/

/**
* @file Defines rules to customize Firefox UI components.
*
* @see http://kb.mozillazine.org/index.php?title=UserChrome.css
*/
19 changes: 19 additions & 0 deletions snowblocks/firefox/chrome/userContent.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (C) 2016-present Arctic Ice Studio <[email protected]>
* Copyright (C) 2016-present Sven Greb <[email protected]>
*
* Project: igloo
* Repository: https://github.com/arcticicestudio/igloo
* License: MIT
*/

/**
* @file Defines rules to modify elements within websites.
*
* @see http://kb.mozillazine.org/index.php?title=UserContent.css
*/

/*+-----------+
+ Extensions +
+------------+*/
@import "content/support/extensions/octotree.css";
36 changes: 36 additions & 0 deletions snowblocks/firefox/containers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"version": 4,
"lastUserContextId": 5,
"identities": [{
"userContextId": 1,
"public": false,
"icon": "",
"color": "",
"name": "userContextIdInternal.thumbnail",
"accessKey": ""
}, {
"userContextId": 2,
"public": true,
"icon": "fingerprint",
"color": "blue",
"name": "Arctic Ice Studio"
}, {
"userContextId": 3,
"public": true,
"icon": "fingerprint",
"color": "blue",
"name": "Sven Greb"
}, {
"userContextId": 4,
"public": true,
"icon": "chill",
"color": "blue",
"name": "Arctic Frost Gaming"
}, {
"userContextId": 5,
"public": true,
"icon": "briefcase",
"color": "green",
"name": "sgreb@communicode"
}]
}
Empty file.
24 changes: 24 additions & 0 deletions snowblocks/firefox/profiles.iceowl.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
; Copyright (C) 2016-present Arctic Ice Studio <[email protected]>
; Copyright (C) 2016-present Sven Greb <[email protected]>

; Project: igloo
; Repository: https://github.com/arcticicestudio/igloo
; License: MIT
; References:
; http://kb.mozillazine.org/Profiles.ini_file
; http://kb.mozillazine.org/Profile_folder_-_Firefox
; http://kb.mozillazine.org/Profile_folder

[General]
StartWithLastProfile=1

[Profile0]
Name=igloo
IsRelative=1
Path=Profiles/igloo
Default=1

[Profile1]
Name=dev-edition-default
IsRelative=1
Path=Profiles/mhtutmh0.dev-edition-default
24 changes: 24 additions & 0 deletions snowblocks/firefox/profiles.igloo.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
; Copyright (C) 2016-present Arctic Ice Studio <[email protected]>
; Copyright (C) 2016-present Sven Greb <[email protected]>

; Project: igloo
; Repository: https://github.com/arcticicestudio/igloo
; License: MIT
; References:
; http://kb.mozillazine.org/Profiles.ini_file
; http://kb.mozillazine.org/Profile_folder_-_Firefox
; http://kb.mozillazine.org/Profile_folder

[General]
StartWithLastProfile=1

[Profile0]
Name=igloo
IsRelative=1
Path=igloo
Default=1

[Profile1]
Name=dev-edition-default
IsRelative=1
Path=mhtutmh0.dev-edition-default
82 changes: 82 additions & 0 deletions snowblocks/firefox/snowblock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
[
{
"clean": [
"~/Library/Application Support/Firefox",
"~/.mozilla/firefox"
]
},
{
"link": {
"~/Library/Application Support/Firefox/Profiles/igloo/chrome": {
"create": true,
"force": true,
"hosts": {
"iceowl": "chrome"
}
},
"~/Library/Application Support/Firefox/Profiles/igloo/containers.json": {
"create": true,
"force": true,
"hosts": {
"iceowl": "containers.json"
}
},
"~/Library/Application Support/Firefox/ignore-dev-edition-profile": {
"create": true,
"force": true,
"hosts": {
"iceowl": "ignore-dev-edition-profile"
}
},
"~/Library/Application Support/Firefox/profiles.ini": {
"create": true,
"force": true,
"hosts": {
"iceowl": "profiles.iceowl.ini"
}
},
"~/Library/Application Support/Firefox/igloo/user.js": {
"create": true,
"force": true,
"hosts": {
"iceowl": "user.js"
}
},
"~/.mozilla/firefox/igloo/chrome": {
"create": true,
"force": true,
"hosts": {
"igloo": "chrome"
}
},
"~/.mozilla/firefox/igloo/containers.json": {
"create": true,
"force": true,
"hosts": {
"igloo": "containers.json"
}
},
"~/.mozilla/firefox/ignore-dev-edition-profile": {
"create": true,
"force": true,
"hosts": {
"igloo": "ignore-dev-edition-profile"
}
},
"~/.mozilla/firefox/profiles.ini": {
"create": true,
"force": true,
"hosts": {
"igloo": "profiles.igloo.ini"
}
},
"~/.mozilla/firefox/igloo/user.js": {
"create": true,
"force": true,
"hosts": {
"igloo": "user.js"
}
}
}
}
]
Loading

0 comments on commit 505e340

Please sign in to comment.