Files
IronFox/scripts/deglean.py
celenity e6c69ef28d IronFox v144.0
ironfox-oss/IronFox!92
____

## Changes

- [Added a separate toggle in settings to enable/disable JIT for **extensions**](48a42e213a) when JIT is otherwise disabled globally *(**Disabled** by default)*, located at `Settings` -> `IronFox` -> `IronFox settings` -> `Security` -> **`Enable JavaScript Just-in-time Compilation (JIT) for extensions`**.
- [Added support for natively enabling/disabling WebGL per-site](5e1acb19a6) via FPP overrides. **It is now recommended to disable the uBlock Origin `Block WebGL` lists** *(The `Block WebGL` lists will be removed from the uBlock Origin config entirely in the near future, but we're keeping them for now to ex. give users time to update)*. See [Notes](#notes) below for details, such as how you can manually allow desired websites to use WebGL.
- [Added a toggle in settings to enable or disable our default WebGL overrides](c9298799ee) *(**Enabled** by default)*, located at `Settings` -> `IronFox` -> `IronFox settings` -> `Privacy` -> **`Enable WebGL overrides from IronFox`**. When WebGL is enabled, this setting enables WebGL by default for certain websites, to reduce breakage/unexpected behavior. Note that this list is **NOT** fetched/updated remotely.
- [Added a toggle in settings to enable or disable spoofing the timezone to `UTC-0`](c8cb5064e4) *(**Disabled** by default)*, located at `Settings` -> `IronFox` -> `IronFox settings` -> `Privacy` -> **`Spoof timezone to UTC-0`**.
- [Added a toggle in settings to enable or disable our default timezone overrides](c8cb5064e4) *(**Enabled** by default)*, located at `Settings` -> `IronFox` -> `IronFox settings` -> `Privacy` -> **`Enable timezone spoofing overrides from IronFox`**. When timezone spoofing is enabled, this setting disables timezone spoofing by default for certain websites, to reduce breakage/unexpected behavior. Note that this list is **NOT** fetched/updated remotely.
- [Added a toggle in settings to enable or disable *Mozilla's* default fingerprinting protection overrides](64e3706be8) to reduce website breakage *(**Enabled** by default)*, located at `Settings` -> `IronFox` -> `IronFox settings` -> `Privacy` -> **`Enable fingerprinting protection overrides from Mozilla`**. Note that this list **IS** fetched/updated remotely.
- [Added a toggle in settings to enable or disable *our* default fingerprinting protection overrides](64e3706be8) to reduce website breakage *(**Enabled** by default)*, located at `Settings` -> `IronFox` -> `IronFox settings` -> `Privacy` -> **`Enable fingerprinting protection overrides from IronFox`**. This toggle does **not** disable fingerprinting protection overrides that we set to **harden** protection for certain websites. Note that this list is **NOT** fetched/updated remotely.
- [Implemented](522770b2dc) [Phoenix's extension blocklist](https://codeberg.org/celenity/Phoenix/src/branch/pages/build/policies/blocklist.json) to block malicious/phishing/sketchy extensions.
- [Locked Gecko preferences controlled by UI settings](bc9df5c52c) *(See [details](https://gitlab.com/ironfox-oss/IronFox/-/blob/dev/docs/FAQ.md#why-are-certain-preferences-locked))*.
- [Prevented the JIT toggle from controlling `javascript.options.main_process_disable_jit`](8171a4da48), as this pref is not required for JIT to function, and is preferable to leave on - even when JIT is enabled, to improve security.
- Updated to Firefox [`144.0`](https://firefox.com/firefox/android/144.0/releasenotes/).
- Updated microG to [`v0.3.10.250932`](https://github.com/microg/GmsCore/releases/tag/v0.3.10.250932).
- Updated Phoenix to [`2025.10.12.1`](https://codeberg.org/celenity/Phoenix/releases/tag/2025.10.12.1).
- [Other minor tweaks, adjustments, and enhancements](https://gitlab.com/ironfox-oss/IronFox/-/merge_requests/92/diffs).

## Notes

You can manually allow websites to use WebGL with the `privacy.fingerprintingProtection.granularOverrides` preference at `about:config`. For instance, if I want to allow **`example.com`** to use WebGL, I would set the value of `privacy.fingerprintingProtection.granularOverrides` to:

```sh
[{"firstPartyDomain":"example.com","overrides":"-DisableWebGL"}]
```

If I *also* wanted to allow `example2.com`, I'd set the value to:

```sh
[{"firstPartyDomain":"example.com","overrides":"-DisableWebGL"},{"firstPartyDomain":"example2.com","overrides":"-DisableWebGL"}]
```

**[Please report websites that require WebGL to us if possible](https://gitlab.com/ironfox-oss/IronFox/-/issues)**, so that we can investigate and potentially add them to the default WebGL overrides list.

MR-author: celenity <celenity@celenity.dev>
Co-authored-by: Weblate <hosted@weblate.org>
Co-authored-by: Akash Yadav <itsaky01@gmail.com>
Approved-by: celenity <celenity@celenity.dev>
Merged-by: celenity <celenity@celenity.dev>
2025-10-16 04:14:42 +00:00

69 lines
2.1 KiB
Python

#!/usr/bin/env python3
import re
import argparse
def deglean(file_path):
"""
Wraps the 'ext { ... }' block in multi-line comments in a Gradle build file
only if it contains lines that start with 'glean'.
"""
with open(file_path, "r") as f:
lines = f.readlines()
processed_lines = []
in_ext_block = False
ext_block_content = []
brace_depth = 0
contains_glean = False
for line in lines:
# Check for the start of the ext block
if not in_ext_block and re.match(r'^\s*ext\s*\{', line):
in_ext_block = True
brace_depth = 1
ext_block_content.append(line)
continue
if in_ext_block:
ext_block_content.append(line)
# Check if the line starts with "glean" (case insensitive)
if line.strip().lower().startswith("glean") and not line.strip().lower().startswith("gleanversion"):
contains_glean = True
brace_depth += line.count("{") - line.count("}")
# Check for the end of the ext block
if brace_depth == 0:
# Wrap the ext block content in multi-line comments only if it contains "Glean"
if contains_glean:
processed_lines.append("/*\n")
processed_lines.extend(ext_block_content)
processed_lines.append("*/\n")
else:
processed_lines.extend(ext_block_content)
# Reset state
in_ext_block = False
ext_block_content = []
contains_glean = False
continue
# If not in an ext block, just append the line
else:
processed_lines.append(line)
with open(file_path, "w") as f:
f.writelines(processed_lines)
def main():
parser = argparse.ArgumentParser(
description="Wrap 'ext { ... }' blocks in multi-line comments in Gradle build files."
)
parser.add_argument("file", help="Path to the Gradle build file")
args = parser.parse_args()
deglean(args.file)
if __name__ == "__main__":
main()