Skip to content

Commit

Permalink
Chromium: Disable Strict mode in Enhanced Tracking Protection in Priv…
Browse files Browse the repository at this point in the history
…acy and Security settings

Chromium doesn't support Strict Tracking Protection, so we disable this in Privacy and Security settings for Chromium.

Fixes Igalia#1714
  • Loading branch information
haanhvu committed Jan 27, 2025
1 parent 6f2c350 commit 55e0d06
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ public int getIdForValue(Object value) {
return 0;
}

public RadioGroup getRadioGroup() {return mRadioGroup;}

public int getCheckedRadioButtonId() {
return mRadioGroup.getCheckedRadioButtonId();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import androidx.databinding.DataBindingUtil;

import com.igalia.wolvic.BuildConfig;
import com.igalia.wolvic.R;
import com.igalia.wolvic.browser.SettingsStore;
import com.igalia.wolvic.browser.api.WRuntime;
Expand All @@ -32,6 +33,8 @@
import com.igalia.wolvic.utils.DeviceType;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

class PrivacyOptionsView extends SettingsView {

Expand Down Expand Up @@ -168,6 +171,12 @@ protected void updateUI() {
mWidgetManager.openNewTabForeground(url);
exitWholeSettings();
});
if (BuildConfig.FLAVOR_backend.equals("chromium")) {
String[] trackingProtectionOptions = getResources().getStringArray(R.array.privacy_options_tracking);
List<String> trackingProtectionOptionsList = Arrays.asList(trackingProtectionOptions);
int strictModeIndex = trackingProtectionOptionsList.indexOf(getResources().getString(R.string.privacy_options_tracking_strict));
mBinding.trackingProtectionRadio.getRadioGroup().getChildAt(strictModeIndex).setVisibility(View.GONE);
}
int etpLevel = SettingsStore.getInstance(getContext()).getTrackingProtectionLevel();
mBinding.trackingProtectionRadio.setOnCheckedChangeListener(mTrackingProtectionListener);
setTrackingProtection(mBinding.trackingProtectionRadio.getIdForValue(etpLevel), false);
Expand Down

0 comments on commit 55e0d06

Please sign in to comment.