<PersistentState>
<option name="values">
<map>
- <entry key="url" value="jar:file:/home/soren/Android/android-studio/plugins/android/lib/android.jar!/images/material_design_icons/action/ic_tab_black_24dp.xml" />
+ <entry key="url" value="jar:file:/home/soren/Android/android-studio/plugins/android/lib/android.jar!/images/material_design_icons/action/ic_settings_overscan_black_24dp.xml" />
</map>
</option>
</PersistentState>
</option>
<option name="values">
<map>
- <entry key="assetSourceType" value="FILE" />
- <entry key="autoMirrored" value="true" />
- <entry key="outputName" value="modify_url" />
+ <entry key="outputName" value="wide_viewport_enabled_light" />
<entry key="sourceFile" value="$USER_HOME$/ownCloud/Android/Privacy Browser/Icons/Icons/link_off_light.svg" />
</map>
</option>
<w>webkay</w>
<w>webkitversion</w>
<w>webpage</w>
+ <w>webpages</w>
<w>websocket</w>
<w>webview</w>
<w>webviewpager</w>
<p><img class="icon" src="../shared_images/search_dark.png"> search.</p>
<p><img class="icon" src="../shared_images/select_all_dark.png"> select_all.</p>
<p><img class="icon" src="../shared_images/settings_dark.png"> settings.</p>
+ <p><img class="icon" src="../shared_images/settings_overscan_dark.png"> settings_overscan.</p>
<p><img class="icon" src="../shared_images/smartphone_dark.png"> smartphone.</p>
<p><img class="icon" src="../shared_images/sort_dark.png"> sort.</p>
<p><img class="icon" src="../shared_images/style_dark.png"> style.</p>
<p><img class="icon" src="../shared_images/search_light.png"> search.</p>
<p><img class="icon" src="../shared_images/select_all_light.png"> select_all.</p>
<p><img class="icon" src="../shared_images/settings_light.png"> settings.</p>
+ <p><img class="icon" src="../shared_images/settings_overscan_light.png"> settings_overscan.</p>
<p><img class="icon" src="../shared_images/smartphone_light.png"> smartphone.</p>
<p><img class="icon" src="../shared_images/sort_light.png"> sort.</p>
<p><img class="icon" src="../shared_images/style_light.png"> style.</p>
<p><img class="icon" src="../shared_images/search_dark.png"> search.</p>
<p><img class="icon" src="../shared_images/select_all_dark.png"> select_all.</p>
<p><img class="icon" src="../shared_images/settings_dark.png"> settings.</p>
+ <p><img class="icon" src="../shared_images/settings_overscan_dark.png"> settings_overscan.</p>
<p><img class="icon" src="../shared_images/smartphone_dark.png"> smartphone.</p>
<p><img class="icon" src="../shared_images/sort_dark.png"> sort.</p>
<p><img class="icon" src="../shared_images/style_dark.png"> style.</p>
<p><img class="icon" src="../shared_images/search_light.png"> search.</p>
<p><img class="icon" src="../shared_images/select_all_light.png"> select_all.</p>
<p><img class="icon" src="../shared_images/settings_light.png"> settings.</p>
+ <p><img class="icon" src="../shared_images/settings_overscan_light.png"> settings_overscan.</p>
<p><img class="icon" src="../shared_images/smartphone_light.png"> smartphone.</p>
<p><img class="icon" src="../shared_images/sort_light.png"> sort.</p>
<p><img class="icon" src="../shared_images/style_light.png"> style.</p>
<p><img class="icon" src="../shared_images/search_dark.png"> search.</p>
<p><img class="icon" src="../shared_images/select_all_dark.png"> select_all.</p>
<p><img class="icon" src="../shared_images/settings_dark.png"> settings.</p>
+ <p><img class="icon" src="../shared_images/settings_overscan_dark.png"> settings_overscan.</p>
<p><img class="icon" src="../shared_images/smartphone_dark.png"> smartphone.</p>
<p><img class="icon" src="../shared_images/sort_dark.png"> sort.</p>
<p><img class="icon" src="../shared_images/style_dark.png"> style.</p>
<p><img class="icon" src="../shared_images/search_light.png"> search.</p>
<p><img class="icon" src="../shared_images/select_all_light.png"> select_all.</p>
<p><img class="icon" src="../shared_images/settings_light.png"> settings.</p>
+ <p><img class="icon" src="../shared_images/settings_overscan_light.png"> settings_overscan.</p>
<p><img class="icon" src="../shared_images/smartphone_light.png"> smartphone.</p>
<p><img class="icon" src="../shared_images/sort_light.png"> sort.</p>
<p><img class="icon" src="../shared_images/style_light.png"> style.</p>
<p><img class="icon" src="../shared_images/search_dark.png"> search.</p>
<p><img class="icon" src="../shared_images/select_all_dark.png"> select_all.</p>
<p><img class="icon" src="../shared_images/settings_dark.png"> settings.</p>
+ <p><img class="icon" src="../shared_images/settings_overscan_dark.png"> settings_overscan.</p>
<p><img class="icon" src="../shared_images/smartphone_dark.png"> smartphone.</p>
<p><img class="icon" src="../shared_images/sort_dark.png"> sort.</p>
<p><img class="icon" src="../shared_images/style_dark.png"> style.</p>
<p><img class="icon" src="../shared_images/search_light.png"> search.</p>
<p><img class="icon" src="../shared_images/select_all_light.png"> select_all.</p>
<p><img class="icon" src="../shared_images/settings_light.png"> settings.</p>
+ <p><img class="icon" src="../shared_images/settings_overscan_light.png"> settings_overscan.</p>
<p><img class="icon" src="../shared_images/smartphone_light.png"> smartphone.</p>
<p><img class="icon" src="../shared_images/sort_light.png"> sort.</p>
<p><img class="icon" src="../shared_images/style_light.png"> style.</p>
<p><img class="icon" src="../shared_images/search_dark.png"> search.</p>
<p><img class="icon" src="../shared_images/select_all_dark.png"> select_all.</p>
<p><img class="icon" src="../shared_images/settings_dark.png"> settings.</p>
+ <p><img class="icon" src="../shared_images/settings_overscan_dark.png"> settings_overscan.</p>
<p><img class="icon" src="../shared_images/smartphone_dark.png"> smartphone.</p>
<p><img class="icon" src="../shared_images/sort_dark.png"> sort.</p>
<p><img class="icon" src="../shared_images/style_dark.png"> style.</p>
<p><img class="icon" src="../shared_images/search_light.png"> search.</p>
<p><img class="icon" src="../shared_images/select_all_light.png"> select_all.</p>
<p><img class="icon" src="../shared_images/settings_light.png"> settings.</p>
+ <p><img class="icon" src="../shared_images/settings_overscan_light.png"> settings_overscan.</p>
<p><img class="icon" src="../shared_images/smartphone_light.png"> smartphone.</p>
<p><img class="icon" src="../shared_images/sort_light.png"> sort.</p>
<p><img class="icon" src="../shared_images/style_light.png"> style.</p>
<p><img class="icon" src="../shared_images/search_dark.png"> search.</p>
<p><img class="icon" src="../shared_images/select_all_dark.png"> select_all.</p>
<p><img class="icon" src="../shared_images/settings_dark.png"> settings.</p>
+ <p><img class="icon" src="../shared_images/settings_overscan_dark.png"> settings_overscan.</p>
<p><img class="icon" src="../shared_images/smartphone_dark.png"> smartphone.</p>
<p><img class="icon" src="../shared_images/sort_dark.png"> sort.</p>
<p><img class="icon" src="../shared_images/style_dark.png"> style.</p>
<p><img class="icon" src="../shared_images/search_light.png"> search.</p>
<p><img class="icon" src="../shared_images/select_all_light.png"> select_all.</p>
<p><img class="icon" src="../shared_images/settings_light.png"> settings.</p>
+ <p><img class="icon" src="../shared_images/settings_overscan_light.png"> settings_overscan.</p>
<p><img class="icon" src="../shared_images/smartphone_light.png"> smartphone.</p>
<p><img class="icon" src="../shared_images/sort_light.png"> sort.</p>
<p><img class="icon" src="../shared_images/style_light.png"> style.</p>
EditText customUserAgentEditText = view.findViewById(R.id.custom_user_agent_edittext);
Spinner fontSizeSpinner = view.findViewById(R.id.font_size_spinner);
Spinner swipeToRefreshSpinner = view.findViewById(R.id.swipe_to_refresh_spinner);
- Spinner displayWebpageImagesSpinner = view.findViewById(R.id.display_webpage_images_spinner);
Spinner nightModeSpinner = view.findViewById(R.id.night_mode_spinner);
+ Spinner wideViewportSpinner = view.findViewById(R.id.wide_viewport_spinner);
+ Spinner displayWebpageImagesSpinner = view.findViewById(R.id.display_webpage_images_spinner);
Switch pinnedSslCertificateSwitch = view.findViewById(R.id.pinned_ssl_certificate_switch);
RadioButton currentWebsiteCertificateRadioButton = view.findViewById(R.id.current_website_certificate_radiobutton);
Switch pinnedIpAddressesSwitch = view.findViewById(R.id.pinned_ip_addresses_switch);
int userAgentPosition = userAgentSpinner.getSelectedItemPosition();
int fontSizePosition = fontSizeSpinner.getSelectedItemPosition();
int swipeToRefreshInt = swipeToRefreshSpinner.getSelectedItemPosition();
- int displayWebpageImagesInt = displayWebpageImagesSpinner.getSelectedItemPosition();
int nightModeInt = nightModeSpinner.getSelectedItemPosition();
+ int wideViewportInt = wideViewportSpinner.getSelectedItemPosition();
+ int displayWebpageImagesInt = displayWebpageImagesSpinner.getSelectedItemPosition();
boolean pinnedSslCertificate = pinnedSslCertificateSwitch.isChecked();
boolean pinnedIpAddress = pinnedIpAddressesSwitch.isChecked();
// Save the domain settings.
domainsDatabaseHelper.updateDomain(DomainsActivity.currentDomainDatabaseId, domainNameString, javaScriptEnabled, firstPartyCookiesEnabled, thirdPartyCookiesEnabled,
domStorageEnabled, formDataEnabled, easyListEnabled, easyPrivacyEnabled, fanboysAnnoyanceEnabled, fanboysSocialBlockingEnabled, ultraPrivacyEnabled, blockAllThirdPartyRequests,
- userAgentName, fontSizeInt, swipeToRefreshInt, nightModeInt, displayWebpageImagesInt, pinnedSslCertificate, pinnedIpAddress);
+ userAgentName, fontSizeInt, swipeToRefreshInt, nightModeInt, wideViewportInt, displayWebpageImagesInt, pinnedSslCertificate, pinnedIpAddress);
// Update the pinned SSL certificate if a new one is checked.
if (currentWebsiteCertificateRadioButton.isChecked()) {
MenuItem blockAllThirdPartyRequestsMenuItem = menu.findItem(R.id.block_all_third_party_requests);
MenuItem fontSizeMenuItem = menu.findItem(R.id.font_size);
MenuItem swipeToRefreshMenuItem = menu.findItem(R.id.swipe_to_refresh);
+ MenuItem wideViewportMenuItem = menu.findItem(R.id.wide_viewport);
MenuItem displayImagesMenuItem = menu.findItem(R.id.display_images);
MenuItem nightModeMenuItem = menu.findItem(R.id.night_mode);
MenuItem proxyThroughOrbotMenuItem = menu.findItem(R.id.proxy_through_orbot);
ultraPrivacyMenuItem.setChecked(currentWebView.isBlocklistEnabled(NestedScrollWebView.ULTRA_PRIVACY));
blockAllThirdPartyRequestsMenuItem.setChecked(currentWebView.isBlocklistEnabled(NestedScrollWebView.THIRD_PARTY_REQUESTS));
swipeToRefreshMenuItem.setChecked(currentWebView.getSwipeToRefresh());
+ wideViewportMenuItem.setChecked(currentWebView.getSettings().getUseWideViewPort());
displayImagesMenuItem.setChecked(currentWebView.getSettings().getLoadsImagesAutomatically());
nightModeMenuItem.setChecked(currentWebView.getNightMode());
}
return true;
+ case R.id.wide_viewport:
+ // Toggle the viewport.
+ currentWebView.getSettings().setUseWideViewPort(!currentWebView.getSettings().getUseWideViewPort());
+ return true;
+
case R.id.display_images:
if (currentWebView.getSettings().getLoadsImagesAutomatically()) { // Images are currently loaded automatically.
// Disable loading of images.
String defaultFontSizeString = sharedPreferences.getString("font_size", getString(R.string.font_size_default_value));
String defaultUserAgentName = sharedPreferences.getString("user_agent", getString(R.string.user_agent_default_value));
boolean defaultSwipeToRefresh = sharedPreferences.getBoolean("swipe_to_refresh", true);
- boolean displayWebpageImages = sharedPreferences.getBoolean("display_webpage_images", true);
boolean darkTheme = sharedPreferences.getBoolean("dark_theme", false);
+ boolean wideViewport = sharedPreferences.getBoolean("wide_viewport", true);
+ boolean displayWebpageImages = sharedPreferences.getBoolean("display_webpage_images", true);
// Get a handle for the cookie manager.
CookieManager cookieManager = CookieManager.getInstance();
int fontSize = currentDomainSettingsCursor.getInt(currentDomainSettingsCursor.getColumnIndex(DomainsDatabaseHelper.FONT_SIZE));
int swipeToRefreshInt = currentDomainSettingsCursor.getInt(currentDomainSettingsCursor.getColumnIndex(DomainsDatabaseHelper.SWIPE_TO_REFRESH));
int nightModeInt = currentDomainSettingsCursor.getInt(currentDomainSettingsCursor.getColumnIndex(DomainsDatabaseHelper.NIGHT_MODE));
+ int wideViewportInt = currentDomainSettingsCursor.getInt(currentDomainSettingsCursor.getColumnIndex(DomainsDatabaseHelper.WIDE_VIEWPORT));
int displayWebpageImagesInt = currentDomainSettingsCursor.getInt(currentDomainSettingsCursor.getColumnIndex(DomainsDatabaseHelper.DISPLAY_IMAGES));
boolean pinnedSslCertificate = (currentDomainSettingsCursor.getInt(currentDomainSettingsCursor.getColumnIndex(DomainsDatabaseHelper.PINNED_SSL_CERTIFICATE)) == 1);
String pinnedSslIssuedToCName = currentDomainSettingsCursor.getString(currentDomainSettingsCursor.getColumnIndex(DomainsDatabaseHelper.SSL_ISSUED_TO_COMMON_NAME));
// Set night mode according to the night mode int.
switch (nightModeInt) {
- case DomainsDatabaseHelper.NIGHT_MODE_SYSTEM_DEFAULT:
+ case DomainsDatabaseHelper.SYSTEM_DEFAULT:
// Set night mode according to the current default.
nestedScrollWebView.setNightMode(sharedPreferences.getBoolean("night_mode", false));
break;
- case DomainsDatabaseHelper.NIGHT_MODE_ENABLED:
+ case DomainsDatabaseHelper.ENABLED:
// Enable night mode.
nestedScrollWebView.setNightMode(true);
break;
- case DomainsDatabaseHelper.NIGHT_MODE_DISABLED:
+ case DomainsDatabaseHelper.DISABLED:
// Disable night mode.
nestedScrollWebView.setNightMode(false);
break;
// Set swipe to refresh.
switch (swipeToRefreshInt) {
- case DomainsDatabaseHelper.SWIPE_TO_REFRESH_SYSTEM_DEFAULT:
+ case DomainsDatabaseHelper.SYSTEM_DEFAULT:
// Store the swipe to refresh status in the nested scroll WebView.
nestedScrollWebView.setSwipeToRefresh(defaultSwipeToRefresh);
swipeRefreshLayout.setEnabled(defaultSwipeToRefresh);
break;
- case DomainsDatabaseHelper.SWIPE_TO_REFRESH_ENABLED:
+ case DomainsDatabaseHelper.ENABLED:
// Store the swipe to refresh status in the nested scroll WebView.
nestedScrollWebView.setSwipeToRefresh(true);
swipeRefreshLayout.setEnabled(true);
break;
- case DomainsDatabaseHelper.SWIPE_TO_REFRESH_DISABLED:
+ case DomainsDatabaseHelper.DISABLED:
// Store the swipe to refresh status in the nested scroll WebView.
nestedScrollWebView.setSwipeToRefresh(false);
swipeRefreshLayout.setEnabled(false);
}
+ // Set the viewport.
+ switch (wideViewportInt) {
+ case DomainsDatabaseHelper.SYSTEM_DEFAULT:
+ nestedScrollWebView.getSettings().setUseWideViewPort(wideViewport);
+ break;
+
+ case DomainsDatabaseHelper.ENABLED:
+ nestedScrollWebView.getSettings().setUseWideViewPort(true);
+ break;
+
+ case DomainsDatabaseHelper.DISABLED:
+ nestedScrollWebView.getSettings().setUseWideViewPort(false);
+ break;
+ }
+
// Set the loading of webpage images.
switch (displayWebpageImagesInt) {
- case DomainsDatabaseHelper.DISPLAY_WEBPAGE_IMAGES_SYSTEM_DEFAULT:
+ case DomainsDatabaseHelper.SYSTEM_DEFAULT:
nestedScrollWebView.getSettings().setLoadsImagesAutomatically(displayWebpageImages);
break;
- case DomainsDatabaseHelper.DISPLAY_WEBPAGE_IMAGES_ENABLED:
+ case DomainsDatabaseHelper.ENABLED:
nestedScrollWebView.getSettings().setLoadsImagesAutomatically(true);
break;
- case DomainsDatabaseHelper.DISPLAY_WEBPAGE_IMAGES_DISABLED:
+ case DomainsDatabaseHelper.DISABLED:
nestedScrollWebView.getSettings().setLoadsImagesAutomatically(false);
break;
}
nestedScrollWebView.getSettings().setUserAgentString(userAgentDataArray[userAgentArrayPosition]);
}
+ // Set the viewport.
+ nestedScrollWebView.getSettings().setUseWideViewPort(wideViewport);
+
// Set the loading of webpage images.
nestedScrollWebView.getSettings().setLoadsImagesAutomatically(displayWebpageImages);
nestedScrollWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_NEVER_ALLOW);
}
- // Set the WebView to use a wide viewport. Otherwise, some web pages will be scrunched and some content will render outside the screen.
- nestedScrollWebView.getSettings().setUseWideViewPort(true);
-
// Set the WebView to load in overview mode (zoomed out to the maximum width).
nestedScrollWebView.getSettings().setLoadWithOverviewMode(true);
@Override
public void onPageFinished(WebView view, String url) {
- // Reset the wide view port if it has been turned off by the waiting for Orbot message.
- if (!waitingForOrbot) {
- // Only use a wide view port if the URL starts with `http`, not for `file://` and `content://`.
- nestedScrollWebView.getSettings().setUseWideViewPort(url.startsWith("http"));
- }
-
// Flush any cookies to persistent storage. The cookie manager has become very lazy about flushing cookies in recent versions.
if (nestedScrollWebView.getAcceptFirstPartyCookies() && Build.VERSION.SDK_INT >= 21) {
CookieManager.getInstance().flush();
Context context = getContext();
Resources resources = getResources();
+ // Remove the error below that the context might be null.
+ assert context != null;
+
// Get a handle for the shared preference.
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
String defaultCustomUserAgentString = sharedPreferences.getString("custom_user_agent", getString(R.string.custom_user_agent_default_value));
String defaultFontSizeString = sharedPreferences.getString("font_size", getString(R.string.font_size_default_value));
boolean defaultSwipeToRefresh = sharedPreferences.getBoolean("swipe_to_refresh", true);
+ boolean darkTheme = sharedPreferences.getBoolean("dark_theme", false);
boolean defaultNightMode = sharedPreferences.getBoolean("night_mode", false);
+ boolean defaultWideViewport = sharedPreferences.getBoolean("wide_viewport", true);
boolean defaultDisplayWebpageImages = sharedPreferences.getBoolean("display_webpage_images", true);
- boolean darkTheme = sharedPreferences.getBoolean("dark_theme", false);
// Get handles for the views in the fragment.
EditText domainNameEditText = domainSettingsView.findViewById(R.id.domain_settings_name_edittext);
ImageView nightModeImageView = domainSettingsView.findViewById(R.id.night_mode_imageview);
Spinner nightModeSpinner = domainSettingsView.findViewById(R.id.night_mode_spinner);
TextView nightModeTextView = domainSettingsView.findViewById(R.id.night_mode_textview);
+ ImageView wideViewportImageView = domainSettingsView.findViewById(R.id.wide_viewport_imageview);
+ Spinner wideViewportSpinner = domainSettingsView.findViewById(R.id.wide_viewport_spinner);
+ TextView wideViewportTextView = domainSettingsView.findViewById(R.id.wide_viewport_textview);
ImageView displayWebpageImagesImageView = domainSettingsView.findViewById(R.id.display_webpage_images_imageview);
Spinner displayWebpageImagesSpinner = domainSettingsView.findViewById(R.id.display_webpage_images_spinner);
TextView displayImagesTextView = domainSettingsView.findViewById(R.id.display_webpage_images_textview);
int fontSizeInt = domainCursor.getInt(domainCursor.getColumnIndex(DomainsDatabaseHelper.FONT_SIZE));
int swipeToRefreshInt = domainCursor.getInt(domainCursor.getColumnIndex(DomainsDatabaseHelper.SWIPE_TO_REFRESH));
int nightModeInt = domainCursor.getInt(domainCursor.getColumnIndex(DomainsDatabaseHelper.NIGHT_MODE));
+ int wideViewportInt = domainCursor.getInt(domainCursor.getColumnIndex(DomainsDatabaseHelper.WIDE_VIEWPORT));
int displayImagesInt = domainCursor.getInt(domainCursor.getColumnIndex(DomainsDatabaseHelper.DISPLAY_IMAGES));
int pinnedSslCertificateInt = domainCursor.getInt(domainCursor.getColumnIndex(DomainsDatabaseHelper.PINNED_SSL_CERTIFICATE));
String savedSslIssuedToCNameString = domainCursor.getString(domainCursor.getColumnIndex(DomainsDatabaseHelper.SSL_ISSUED_TO_COMMON_NAME));
ArrayAdapter<CharSequence> fontSizeEntryValuesArrayAdapter = ArrayAdapter.createFromResource(context, R.array.domain_settings_font_size_entry_values, R.layout.spinner_item);
ArrayAdapter<CharSequence> swipeToRefreshArrayAdapter = ArrayAdapter.createFromResource(context, R.array.swipe_to_refresh_array, R.layout.spinner_item);
ArrayAdapter<CharSequence> nightModeArrayAdapter = ArrayAdapter.createFromResource(context, R.array.night_mode_array, R.layout.spinner_item);
+ ArrayAdapter<CharSequence> wideViewportArrayAdapter = ArrayAdapter.createFromResource(context, R.array.wide_viewport_array, R.layout.spinner_item);
ArrayAdapter<CharSequence> displayImagesArrayAdapter = ArrayAdapter.createFromResource(context, R.array.display_webpage_images_array, R.layout.spinner_item);
// Set the drop down view resource on the spinners.
fontSizeArrayAdapter.setDropDownViewResource(R.layout.domain_settings_spinner_dropdown_items);
swipeToRefreshArrayAdapter.setDropDownViewResource(R.layout.domain_settings_spinner_dropdown_items);
nightModeArrayAdapter.setDropDownViewResource(R.layout.domain_settings_spinner_dropdown_items);
+ wideViewportArrayAdapter.setDropDownViewResource(R.layout.domain_settings_spinner_dropdown_items);
displayImagesArrayAdapter.setDropDownViewResource(R.layout.domain_settings_spinner_dropdown_items);
// Set the array adapters for the spinners.
fontSizeSpinner.setAdapter(fontSizeArrayAdapter);
swipeToRefreshSpinner.setAdapter(swipeToRefreshArrayAdapter);
nightModeSpinner.setAdapter(nightModeArrayAdapter);
+ wideViewportSpinner.setAdapter(wideViewportArrayAdapter);
displayWebpageImagesSpinner.setAdapter(displayImagesArrayAdapter);
// Create a spannable string builder for each TextView that needs multiple colors of text.
});
// Create a boolean to track if night mode is enabled.
- boolean nightModeEnabled = (nightModeInt == DomainsDatabaseHelper.NIGHT_MODE_ENABLED) || ((nightModeInt == DomainsDatabaseHelper.NIGHT_MODE_SYSTEM_DEFAULT) && defaultNightMode);
+ boolean nightModeEnabled = (nightModeInt == DomainsDatabaseHelper.ENABLED) || ((nightModeInt == DomainsDatabaseHelper.SYSTEM_DEFAULT) && defaultNightMode);
// Disable the JavaScript switch if night mode is enabled.
if (nightModeEnabled) {
}
}
- // Open the user agent spinner when the TextView is clicked.
+ // Open the user agent spinner when the text view is clicked.
userAgentTextView.setOnClickListener((View v) -> {
// Open the user agent spinner.
userAgentSpinner.performClick();
// Set the swipe to refresh text.
if (defaultSwipeToRefresh) {
- swipeToRefreshTextView.setText(swipeToRefreshArrayAdapter.getItem(DomainsDatabaseHelper.SWIPE_TO_REFRESH_ENABLED));
+ swipeToRefreshTextView.setText(swipeToRefreshArrayAdapter.getItem(DomainsDatabaseHelper.ENABLED));
} else {
- swipeToRefreshTextView.setText(swipeToRefreshArrayAdapter.getItem(DomainsDatabaseHelper.SWIPE_TO_REFRESH_DISABLED));
+ swipeToRefreshTextView.setText(swipeToRefreshArrayAdapter.getItem(DomainsDatabaseHelper.DISABLED));
}
// Set the swipe to refresh icon and TextView settings. Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
switch (swipeToRefreshInt) {
- case DomainsDatabaseHelper.SWIPE_TO_REFRESH_SYSTEM_DEFAULT:
+ case DomainsDatabaseHelper.SYSTEM_DEFAULT:
if (defaultSwipeToRefresh) { // Swipe to refresh is enabled by default.
// Set the icon according to the theme.
if (darkTheme) {
swipeToRefreshTextView.setVisibility(View.VISIBLE);
break;
- case DomainsDatabaseHelper.SWIPE_TO_REFRESH_ENABLED:
+ case DomainsDatabaseHelper.ENABLED:
// Set the icon according to the theme.
if (darkTheme) {
swipeToRefreshImageView.setImageDrawable(resources.getDrawable(R.drawable.refresh_enabled_dark));
swipeToRefreshTextView.setVisibility(View.GONE);
break;
- case DomainsDatabaseHelper.SWIPE_TO_REFRESH_DISABLED:
+ case DomainsDatabaseHelper.DISABLED:
// Set the icon according to the theme.
if (darkTheme) {
swipeToRefreshImageView.setImageDrawable(resources.getDrawable(R.drawable.refresh_disabled_dark));
// Set the default night mode text.
if (defaultNightMode) {
- nightModeTextView.setText(nightModeArrayAdapter.getItem(DomainsDatabaseHelper.NIGHT_MODE_ENABLED));
+ nightModeTextView.setText(nightModeArrayAdapter.getItem(DomainsDatabaseHelper.ENABLED));
} else {
- nightModeTextView.setText(nightModeArrayAdapter.getItem(DomainsDatabaseHelper.NIGHT_MODE_DISABLED));
+ nightModeTextView.setText(nightModeArrayAdapter.getItem(DomainsDatabaseHelper.DISABLED));
}
// Set the night mode icon and TextView settings. Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
switch (nightModeInt) {
- case DomainsDatabaseHelper.NIGHT_MODE_SYSTEM_DEFAULT:
+ case DomainsDatabaseHelper.SYSTEM_DEFAULT:
if (defaultNightMode) { // Night mode enabled by default.
// Set the icon according to the theme.
if (darkTheme) {
nightModeTextView.setVisibility(View.VISIBLE);
break;
- case DomainsDatabaseHelper.NIGHT_MODE_ENABLED:
+ case DomainsDatabaseHelper.ENABLED:
// Set the icon according to the theme.
if (darkTheme) {
nightModeImageView.setImageDrawable(resources.getDrawable(R.drawable.night_mode_enabled_dark));
nightModeTextView.setVisibility(View.GONE);
break;
- case DomainsDatabaseHelper.NIGHT_MODE_DISABLED:
+ case DomainsDatabaseHelper.DISABLED:
// Set the icon according to the theme.
if (darkTheme) {
nightModeImageView.setImageDrawable(resources.getDrawable(R.drawable.night_mode_disabled_dark));
nightModeSpinner.performClick();
});
+ // Display the wide viewport in the spinner.
+ wideViewportSpinner.setSelection(wideViewportInt);
+
+ // Set the default wide viewport text.
+ if (defaultWideViewport) {
+ wideViewportTextView.setText(wideViewportArrayAdapter.getItem(DomainsDatabaseHelper.ENABLED));
+ } else {
+ wideViewportTextView.setText(wideViewportArrayAdapter.getItem(DomainsDatabaseHelper.DISABLED));
+ }
+
+ // Set the wide viewport icon and text view settings. Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
+ switch (wideViewportInt) {
+ case DomainsDatabaseHelper.SYSTEM_DEFAULT:
+ if (defaultWideViewport) { // Wide viewport enabled by default.
+ // Set the icon according to the theme.
+ if (darkTheme) {
+ wideViewportImageView.setImageDrawable(resources.getDrawable(R.drawable.wide_viewport_enabled_dark));
+ } else {
+ wideViewportImageView.setImageDrawable(resources.getDrawable(R.drawable.wide_viewport_enabled_light));
+ }
+ } else { // Wide viewport disabled by default.
+ if (darkTheme) {
+ wideViewportImageView.setImageDrawable(resources.getDrawable(R.drawable.wide_viewport_disabled_dark));
+ } else {
+ wideViewportImageView.setImageDrawable(resources.getDrawable(R.drawable.wide_viewport_disabled_light));
+ }
+ }
+
+ // Show the wide viewport text view.
+ wideViewportTextView.setVisibility(View.VISIBLE);
+ break;
+
+ case DomainsDatabaseHelper.ENABLED:
+ // Set the icon according to the theme.
+ if (darkTheme) {
+ wideViewportImageView.setImageDrawable(resources.getDrawable(R.drawable.wide_viewport_enabled_dark));
+ } else {
+ wideViewportImageView.setImageDrawable(resources.getDrawable(R.drawable.wide_viewport_enabled_light));
+ }
+
+ // Hide the wide viewport text view.
+ wideViewportTextView.setVisibility(View.GONE);
+ break;
+
+ case DomainsDatabaseHelper.DISABLED:
+ // Set the icon according to the theme.
+ if (darkTheme) {
+ wideViewportImageView.setImageDrawable(resources.getDrawable(R.drawable.wide_viewport_disabled_dark));
+ } else {
+ wideViewportImageView.setImageDrawable(resources.getDrawable(R.drawable.wide_viewport_disabled_light));
+ }
+
+ // Hide the wide viewport text view.
+ wideViewportTextView.setVisibility(View.GONE);
+ break;
+ }
+
+ // Open the wide viewport spinner when the text view is clicked.
+ wideViewportTextView.setOnClickListener((View view) -> {
+ // Open the wide viewport spinner.
+ wideViewportSpinner.performClick();
+ });
+
// Display the website images mode in the spinner.
displayWebpageImagesSpinner.setSelection(displayImagesInt);
// Set the default display images text.
if (defaultDisplayWebpageImages) {
- displayImagesTextView.setText(displayImagesArrayAdapter.getItem(DomainsDatabaseHelper.DISPLAY_WEBPAGE_IMAGES_ENABLED));
+ displayImagesTextView.setText(displayImagesArrayAdapter.getItem(DomainsDatabaseHelper.ENABLED));
} else {
- displayImagesTextView.setText(displayImagesArrayAdapter.getItem(DomainsDatabaseHelper.DISPLAY_WEBPAGE_IMAGES_DISABLED));
+ displayImagesTextView.setText(displayImagesArrayAdapter.getItem(DomainsDatabaseHelper.DISABLED));
}
- // Set the display website images icon and TextView settings. Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
+ // Set the display website images icon and text view settings. Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
switch (displayImagesInt) {
- case DomainsDatabaseHelper.DISPLAY_WEBPAGE_IMAGES_SYSTEM_DEFAULT:
+ case DomainsDatabaseHelper.SYSTEM_DEFAULT:
if (defaultDisplayWebpageImages) { // Display webpage images enabled by default.
// Set the icon according to the theme.
if (darkTheme) {
}
}
- // Show the display images TextView.
+ // Show the display images text view.
displayImagesTextView.setVisibility(View.VISIBLE);
break;
- case DomainsDatabaseHelper.DISPLAY_WEBPAGE_IMAGES_ENABLED:
+ case DomainsDatabaseHelper.ENABLED:
// Set the icon according to the theme.
if (darkTheme) {
displayWebpageImagesImageView.setImageDrawable(resources.getDrawable(R.drawable.images_enabled_dark));
displayWebpageImagesImageView.setImageDrawable(resources.getDrawable(R.drawable.images_enabled_light));
}
- // Hide the display images TextView.
+ // Hide the display images text view.
displayImagesTextView.setVisibility(View.GONE);
break;
- case DomainsDatabaseHelper.DISPLAY_WEBPAGE_IMAGES_DISABLED:
+ case DomainsDatabaseHelper.DISABLED:
// Set the icon according to the theme.
if (darkTheme) {
displayWebpageImagesImageView.setImageDrawable(resources.getDrawable(R.drawable.images_disabled_dark));
displayWebpageImagesImageView.setImageDrawable(resources.getDrawable(R.drawable.images_disabled_light));
}
- // Hide the display images TextView.
+ // Hide the display images text view.
displayImagesTextView.setVisibility(View.GONE);
break;
}
- // Open the display images spinner when the TextView is clicked.
- displayImagesTextView.setOnClickListener((View v) -> {
+ // Open the display images spinner when the text view is clicked.
+ displayImagesTextView.setOnClickListener((View view) -> {
// Open the user agent spinner.
displayWebpageImagesSpinner.performClick();
});
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
// Update the icon and the visibility of `nightModeTextView`. Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
switch (position) {
- case DomainsDatabaseHelper.SWIPE_TO_REFRESH_SYSTEM_DEFAULT:
+ case DomainsDatabaseHelper.SYSTEM_DEFAULT:
if (defaultSwipeToRefresh) { // Swipe to refresh enabled by default.
// Set the icon according to the theme.
if (darkTheme) {
swipeToRefreshTextView.setVisibility(View.VISIBLE);
break;
- case DomainsDatabaseHelper.SWIPE_TO_REFRESH_ENABLED:
+ case DomainsDatabaseHelper.ENABLED:
// Set the icon according to the theme.
if (darkTheme) {
swipeToRefreshImageView.setImageDrawable(resources.getDrawable(R.drawable.refresh_enabled_dark));
swipeToRefreshTextView.setVisibility(View.GONE);
break;
- case DomainsDatabaseHelper.SWIPE_TO_REFRESH_DISABLED:
+ case DomainsDatabaseHelper.DISABLED:
// Set the icon according to the theme.
if (darkTheme) {
swipeToRefreshImageView.setImageDrawable(resources.getDrawable(R.drawable.refresh_disabled_dark));
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
// Update the icon and the visibility of `nightModeTextView`. Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
switch (position) {
- case DomainsDatabaseHelper.NIGHT_MODE_SYSTEM_DEFAULT:
+ case DomainsDatabaseHelper.SYSTEM_DEFAULT:
if (defaultNightMode) { // Night mode enabled by default.
// Set the icon according to the theme.
if (darkTheme) {
nightModeTextView.setVisibility(View.VISIBLE);
break;
- case DomainsDatabaseHelper.NIGHT_MODE_ENABLED:
+ case DomainsDatabaseHelper.ENABLED:
// Set the icon according to the theme.
if (darkTheme) {
nightModeImageView.setImageDrawable(resources.getDrawable(R.drawable.night_mode_enabled_dark));
nightModeTextView.setVisibility(View.GONE);
break;
- case DomainsDatabaseHelper.NIGHT_MODE_DISABLED:
+ case DomainsDatabaseHelper.DISABLED:
// Set the icon according to the theme.
if (darkTheme) {
nightModeImageView.setImageDrawable(resources.getDrawable(R.drawable.night_mode_disabled_dark));
}
// Create a `boolean` to store the current night mode setting.
- boolean currentNightModeEnabled = (position == DomainsDatabaseHelper.NIGHT_MODE_ENABLED) || ((position == DomainsDatabaseHelper.NIGHT_MODE_SYSTEM_DEFAULT) && defaultNightMode);
+ boolean currentNightModeEnabled = (position == DomainsDatabaseHelper.ENABLED) || ((position == DomainsDatabaseHelper.SYSTEM_DEFAULT) && defaultNightMode);
// Disable the JavaScript `Switch` if night mode is enabled.
if (currentNightModeEnabled) {
}
});
+ // Set the wide viewport spinner listener.
+ wideViewportSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
+ // Update the icon and the visibility of the wide viewport text view.
+ switch (position) {
+ case DomainsDatabaseHelper.SYSTEM_DEFAULT:
+ if (defaultWideViewport) { // Wide viewport is enabled by default.
+ // Set the icon according to the theme.
+ if (darkTheme) {
+ wideViewportImageView.setImageDrawable(resources.getDrawable(R.drawable.wide_viewport_enabled_dark));
+ } else {
+ wideViewportImageView.setImageDrawable(resources.getDrawable(R.drawable.wide_viewport_enabled_light));
+ }
+ } else { // Wide viewport is disabled by default.
+ if (darkTheme) {
+ wideViewportImageView.setImageDrawable(resources.getDrawable(R.drawable.wide_viewport_disabled_dark));
+ } else {
+ wideViewportImageView.setImageDrawable(resources.getDrawable(R.drawable.wide_viewport_disabled_light));
+ }
+ }
+
+ // Show the wide viewport text view.
+ wideViewportTextView.setVisibility(View.VISIBLE);
+ break;
+
+ case DomainsDatabaseHelper.ENABLED:
+ // Set the icon according to the theme.
+ if (darkTheme) {
+ wideViewportImageView.setImageDrawable(resources.getDrawable(R.drawable.wide_viewport_enabled_dark));
+ } else {
+ wideViewportImageView.setImageDrawable(resources.getDrawable(R.drawable.wide_viewport_enabled_light));
+ }
+
+ // Hide the wide viewport text view.
+ wideViewportTextView.setVisibility(View.GONE);
+ break;
+
+ case DomainsDatabaseHelper.DISABLED:
+ // Set the icon according to the theme.
+ if (darkTheme) {
+ wideViewportImageView.setImageDrawable(resources.getDrawable(R.drawable.wide_viewport_disabled_dark));
+ } else {
+ wideViewportImageView.setImageDrawable(resources.getDrawable(R.drawable.wide_viewport_disabled_light));
+ }
+
+ // Hid ethe wide viewport text view.
+ wideViewportTextView.setVisibility(View.GONE);
+ break;
+ }
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView<?> parent) {
+ // Do nothing.
+ }
+ });
+
// Set the display webpage images spinner listener.
displayWebpageImagesSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
- // Update the icon and the visibility of `displayImagesTextView`.
+ // Update the icon and the visibility of the display images text view.
switch (position) {
- case DomainsDatabaseHelper.DISPLAY_WEBPAGE_IMAGES_SYSTEM_DEFAULT:
- if (defaultDisplayWebpageImages) {
+ case DomainsDatabaseHelper.SYSTEM_DEFAULT:
+ if (defaultDisplayWebpageImages) { // Display webpage images is enabled by default.
// Set the icon according to the theme.
if (darkTheme) {
displayWebpageImagesImageView.setImageDrawable(resources.getDrawable(R.drawable.images_enabled_dark));
} else {
displayWebpageImagesImageView.setImageDrawable(resources.getDrawable(R.drawable.images_enabled_light));
}
- } else {
+ } else { // Display webpage images is disabled by default.
// Set the icon according to the theme.
if (darkTheme) {
displayWebpageImagesImageView.setImageDrawable(resources.getDrawable(R.drawable.images_disabled_dark));
}
}
- // Show `displayImagesTextView`.
+ // Show the display images text view.
displayImagesTextView.setVisibility(View.VISIBLE);
break;
- case DomainsDatabaseHelper.DISPLAY_WEBPAGE_IMAGES_ENABLED:
+ case DomainsDatabaseHelper.ENABLED:
// Set the icon according to the theme.
if (darkTheme) {
displayWebpageImagesImageView.setImageDrawable(resources.getDrawable(R.drawable.images_enabled_dark));
displayWebpageImagesImageView.setImageDrawable(resources.getDrawable(R.drawable.images_enabled_light));
}
- // Hide `displayImagesTextView`.
+ // Hide the display images text view.
displayImagesTextView.setVisibility(View.GONE);
break;
- case DomainsDatabaseHelper.DISPLAY_WEBPAGE_IMAGES_DISABLED:
+ case DomainsDatabaseHelper.DISABLED:
// Set the icon according to the theme.
if (darkTheme) {
displayWebpageImagesImageView.setImageDrawable(resources.getDrawable(R.drawable.images_disabled_dark));
displayWebpageImagesImageView.setImageDrawable(resources.getDrawable(R.drawable.images_disabled_light));
}
- // Hide `displayImagesTextView`.
+ // Hide the display images text view.
displayImagesTextView.setVisibility(View.GONE);
break;
}
Preference downloadWithExternalAppPreference = findPreference("download_with_external_app");
Preference darkThemePreference = findPreference("dark_theme");
Preference nightModePreference = findPreference("night_mode");
+ Preference wideViewportPreference = findPreference("wide_viewport");
Preference displayWebpageImagesPreference = findPreference("display_webpage_images");
// Set dependencies.
}
}
+ // Set the wide viewport preference icon.
+ if (savedPreferences.getBoolean("wide_viewport", true)) {
+ if (darkTheme) {
+ wideViewportPreference.setIcon(R.drawable.wide_viewport_enabled_dark);
+ } else {
+ wideViewportPreference.setIcon(R.drawable.wide_viewport_enabled_light);
+ }
+ } else {
+ if (darkTheme) {
+ wideViewportPreference.setIcon(R.drawable.wide_viewport_disabled_dark);
+ } else {
+ wideViewportPreference.setIcon(R.drawable.wide_viewport_disabled_light);
+ }
+ }
+
// Set the display webpage images preference icon.
if (savedPreferences.getBoolean("display_webpage_images", true)) {
if (darkTheme) {
}
break;
+ case "wide_viewport":
+ // Update the icon.
+ if (sharedPreferences.getBoolean("wide_viewport", true)) {
+ if (darkTheme) {
+ wideViewportPreference.setIcon(R.drawable.wide_viewport_enabled_dark);
+ } else {
+ wideViewportPreference.setIcon(R.drawable.wide_viewport_enabled_light);
+ }
+ } else {
+ if (darkTheme) {
+ wideViewportPreference.setIcon(R.drawable.wide_viewport_disabled_dark);
+ } else {
+ wideViewportPreference.setIcon(R.drawable.wide_viewport_disabled_light);
+ }
+ }
+ break;
+
case "display_webpage_images":
+ // Update the icon.
if (sharedPreferences.getBoolean("display_webpage_images", true)) {
- // Update the icon.
if (darkTheme) {
displayWebpageImagesPreference.setIcon(R.drawable.images_enabled_dark);
} else {
displayWebpageImagesPreference.setIcon(R.drawable.images_enabled_light);
}
} else {
- // Update the icon.
if (darkTheme) {
displayWebpageImagesPreference.setIcon(R.drawable.images_disabled_dark);
} else {
super.onResume();
savedPreferences.registerOnSharedPreferenceChangeListener(preferencesListener);
}
-}
+}
\ No newline at end of file
import android.preference.PreferenceManager;
public class DomainsDatabaseHelper extends SQLiteOpenHelper {
- private static final int SCHEMA_VERSION = 9;
+ private static final int SCHEMA_VERSION = 10;
static final String DOMAINS_DATABASE = "domains.db";
static final String DOMAINS_TABLE = "domains";
public static final String FONT_SIZE = "fontsize";
public static final String SWIPE_TO_REFRESH = "swipetorefresh";
public static final String NIGHT_MODE = "nightmode";
+ public static final String WIDE_VIEWPORT = "wide_viewport";
public static final String DISPLAY_IMAGES = "displayimages";
public static final String PINNED_SSL_CERTIFICATE = "pinnedsslcertificate";
public static final String SSL_ISSUED_TO_COMMON_NAME = "sslissuedtocommonname";
public static final String PINNED_IP_ADDRESSES = "pinned_ip_addresses";
public static final String IP_ADDRESSES = "ip_addresses";
- // Swipe to refresh constants.
- public static final int SWIPE_TO_REFRESH_SYSTEM_DEFAULT = 0;
- public static final int SWIPE_TO_REFRESH_ENABLED = 1;
- public static final int SWIPE_TO_REFRESH_DISABLED = 2;
-
- // Night mode constants.
- public static final int NIGHT_MODE_SYSTEM_DEFAULT = 0;
- public static final int NIGHT_MODE_ENABLED = 1;
- public static final int NIGHT_MODE_DISABLED = 2;
-
- // Display webpage images constants.
- public static final int DISPLAY_WEBPAGE_IMAGES_SYSTEM_DEFAULT = 0;
- public static final int DISPLAY_WEBPAGE_IMAGES_ENABLED = 1;
- public static final int DISPLAY_WEBPAGE_IMAGES_DISABLED = 2;
+ // Spinner constants.
+ public static final int SYSTEM_DEFAULT = 0;
+ public static final int ENABLED = 1;
+ public static final int DISABLED = 2;
static final String CREATE_DOMAINS_TABLE = "CREATE TABLE " + DOMAINS_TABLE + " (" +
_ID + " INTEGER PRIMARY KEY, " +
FONT_SIZE + " INTEGER, " +
SWIPE_TO_REFRESH + " INTEGER, " +
NIGHT_MODE + " INTEGER, " +
+ WIDE_VIEWPORT + " INTEGER, " +
DISPLAY_IMAGES + " INTEGER, " +
PINNED_SSL_CERTIFICATE + " BOOLEAN, " +
SSL_ISSUED_TO_COMMON_NAME + " TEXT, " +
// Add the Pinned IP Addresses columns.
domainsDatabase.execSQL("ALTER TABLE " + DOMAINS_TABLE + " ADD COLUMN " + PINNED_IP_ADDRESSES + " BOOLEAN");
domainsDatabase.execSQL("ALTER TABLE " + DOMAINS_TABLE + " ADD COLUMN " + IP_ADDRESSES + " TEXT");
+
+ // Upgrade from schema version 9.
+ case 9:
+ // Add the Wide Viewport column.
+ domainsDatabase.execSQL("ALTER TABLE " + DOMAINS_TABLE + " ADD COLUMN " + WIDE_VIEWPORT + " INTEGER");
}
}
domainContentValues.put(FONT_SIZE, 0);
domainContentValues.put(SWIPE_TO_REFRESH, 0);
domainContentValues.put(NIGHT_MODE, 0);
+ domainContentValues.put(WIDE_VIEWPORT, 0);
domainContentValues.put(DISPLAY_IMAGES, 0);
// Get a writable database handle.
public void updateDomain(int databaseId, String domainName, boolean javaScriptEnabled, boolean firstPartyCookiesEnabled, boolean thirdPartyCookiesEnabled, boolean domStorageEnabled, boolean formDataEnabled,
boolean easyListEnabled, boolean easyPrivacyEnabled, boolean fanboysAnnoyanceEnabled, boolean fanboysSocialBlockingEnabled, boolean ultraPrivacyEnabled,
- boolean blockAllThirdPartyRequests, String userAgent, int fontSize, int swipeToRefresh, int nightMode, int displayImages, boolean pinnedSslCertificate, boolean pinnedIpAddresses) {
+ boolean blockAllThirdPartyRequests, String userAgent, int fontSize, int swipeToRefresh, int nightMode, int wideViewport, int displayImages, boolean pinnedSslCertificate,
+ boolean pinnedIpAddresses) {
// Store the domain data in a `ContentValues`.
ContentValues domainContentValues = new ContentValues();
domainContentValues.put(FONT_SIZE, fontSize);
domainContentValues.put(SWIPE_TO_REFRESH, swipeToRefresh);
domainContentValues.put(NIGHT_MODE, nightMode);
+ domainContentValues.put(WIDE_VIEWPORT, wideViewport);
domainContentValues.put(DISPLAY_IMAGES, displayImages);
domainContentValues.put(PINNED_SSL_CERTIFICATE, pinnedSslCertificate);
domainContentValues.put(PINNED_IP_ADDRESSES, pinnedIpAddresses);
public static final String EXPORT_SUCCESSFUL = "Export Successful";
public static final String IMPORT_SUCCESSFUL = "Import Successful";
- private static final int SCHEMA_VERSION = 6;
+ private static final int SCHEMA_VERSION = 7;
private static final String PREFERENCES_TABLE = "preferences";
// The preferences constants.
private static final String FANBOYS_SOCIAL_BLOCKING_LIST = "fanboys_social_blocking_list";
private static final String ULTRAPRIVACY = "ultraprivacy";
private static final String BLOCK_ALL_THIRD_PARTY_REQUESTS = "block_all_third_party_requests";
+ private static final String GOOGLE_ANALYTICS = "google_analytics";
+ private static final String FACEBOOK_CLICK_IDS = "facebook_click_ids";
+ private static final String TWITTER_AMP_REDIRECTS = "twitter_amp_redirects";
private static final String PROXY_THROUGH_ORBOT = "proxy_through_orbot";
private static final String TOR_HOMEPAGE = "tor_homepage";
private static final String TOR_SEARCH = "tor_search";
private static final String DOWNLOAD_WITH_EXTERNAL_APP = "download_with_external_app";
private static final String DARK_THEME = "dark_theme";
private static final String NIGHT_MODE = "night_mode";
+ private static final String WIDE_VIEWPORT = "wide_viewport";
private static final String DISPLAY_WEBPAGE_IMAGES = "display_webpage_images";
public String exportUnencrypted(File exportFile, Context context) {
domainsContentValues.put(DomainsDatabaseHelper.FONT_SIZE, domainsCursor.getInt(domainsCursor.getColumnIndex(DomainsDatabaseHelper.FONT_SIZE)));
domainsContentValues.put(DomainsDatabaseHelper.SWIPE_TO_REFRESH, domainsCursor.getInt(domainsCursor.getColumnIndex(DomainsDatabaseHelper.SWIPE_TO_REFRESH)));
domainsContentValues.put(DomainsDatabaseHelper.NIGHT_MODE, domainsCursor.getInt(domainsCursor.getColumnIndex(DomainsDatabaseHelper.NIGHT_MODE)));
+ domainsContentValues.put(DomainsDatabaseHelper.WIDE_VIEWPORT, domainsCursor.getInt(domainsCursor.getColumnIndex(DomainsDatabaseHelper.WIDE_VIEWPORT)));
domainsContentValues.put(DomainsDatabaseHelper.DISPLAY_IMAGES, domainsCursor.getInt(domainsCursor.getColumnIndex(DomainsDatabaseHelper.DISPLAY_IMAGES)));
domainsContentValues.put(DomainsDatabaseHelper.PINNED_SSL_CERTIFICATE, domainsCursor.getInt(domainsCursor.getColumnIndex(DomainsDatabaseHelper.PINNED_SSL_CERTIFICATE)));
domainsContentValues.put(DomainsDatabaseHelper.SSL_ISSUED_TO_COMMON_NAME, domainsCursor.getString(domainsCursor.getColumnIndex(DomainsDatabaseHelper.SSL_ISSUED_TO_COMMON_NAME)));
FANBOYS_SOCIAL_BLOCKING_LIST + " BOOLEAN, " +
ULTRAPRIVACY + " BOOLEAN, " +
BLOCK_ALL_THIRD_PARTY_REQUESTS + " BOOLEAN, " +
+ GOOGLE_ANALYTICS + " BOOLEAN, " +
+ FACEBOOK_CLICK_IDS + " BOOLEAN, " +
+ TWITTER_AMP_REDIRECTS + " BOOLEAN, " +
PROXY_THROUGH_ORBOT + " BOOLEAN, " +
TOR_HOMEPAGE + " TEXT, " +
TOR_SEARCH + " TEXT, " +
DOWNLOAD_WITH_EXTERNAL_APP + " BOOLEAN, " +
DARK_THEME + " BOOLEAN, " +
NIGHT_MODE + " BOOLEAN, " +
+ WIDE_VIEWPORT + " BOOLEAN, " +
DISPLAY_WEBPAGE_IMAGES + " BOOLEAN)";
// Create the export database preferences table.
preferencesContentValues.put(FANBOYS_SOCIAL_BLOCKING_LIST, sharedPreferences.getBoolean(FANBOYS_SOCIAL_BLOCKING_LIST, true));
preferencesContentValues.put(ULTRAPRIVACY, sharedPreferences.getBoolean(ULTRAPRIVACY, true));
preferencesContentValues.put(BLOCK_ALL_THIRD_PARTY_REQUESTS, sharedPreferences.getBoolean(BLOCK_ALL_THIRD_PARTY_REQUESTS, false));
+ preferencesContentValues.put(GOOGLE_ANALYTICS, sharedPreferences.getBoolean(GOOGLE_ANALYTICS, true));
+ preferencesContentValues.put(FACEBOOK_CLICK_IDS, sharedPreferences.getBoolean(FACEBOOK_CLICK_IDS, true));
+ preferencesContentValues.put(TWITTER_AMP_REDIRECTS, sharedPreferences.getBoolean(TWITTER_AMP_REDIRECTS, true));
preferencesContentValues.put(PROXY_THROUGH_ORBOT, sharedPreferences.getBoolean(PROXY_THROUGH_ORBOT, false));
preferencesContentValues.put(TOR_HOMEPAGE, sharedPreferences.getString(TOR_HOMEPAGE, context.getString(R.string.tor_homepage_default_value)));
preferencesContentValues.put(TOR_SEARCH, sharedPreferences.getString(TOR_SEARCH, context.getString(R.string.tor_search_default_value)));
preferencesContentValues.put(DOWNLOAD_WITH_EXTERNAL_APP, sharedPreferences.getBoolean(DOWNLOAD_WITH_EXTERNAL_APP, false));
preferencesContentValues.put(DARK_THEME, sharedPreferences.getBoolean(DARK_THEME, false));
preferencesContentValues.put(NIGHT_MODE, sharedPreferences.getBoolean(NIGHT_MODE, false));
+ preferencesContentValues.put(WIDE_VIEWPORT, sharedPreferences.getBoolean(WIDE_VIEWPORT, true));
preferencesContentValues.put(DISPLAY_WEBPAGE_IMAGES, sharedPreferences.getBoolean(DISPLAY_WEBPAGE_IMAGES, true));
// Insert the preferences into the export database.
switch (importDatabaseVersion){
// Upgrade from schema version 1.
case 1:
- // Add the download with external app preference.
+ // Add the download with external app column to the preferences table.
importDatabase.execSQL("ALTER TABLE " + PREFERENCES_TABLE + " ADD COLUMN " + DOWNLOAD_WITH_EXTERNAL_APP + " BOOLEAN");
// Get the current setting for downloading with an external app.
// Upgrade from schema version 4.
case 4:
- // Add the hide and scroll app bar preferences.
+ // Add the hide and scroll app bar columns to the preferences table.
importDatabase.execSQL("ALTER TABLE " + PREFERENCES_TABLE + " ADD COLUMN " + HIDE_APP_BAR + " BOOLEAN");
importDatabase.execSQL("ALTER TABLE " + PREFERENCES_TABLE + " ADD COLUMN " + SCROLL_APP_BAR + " BOOLEAN");
// Upgrade from schema version 5.
case 5:
- // Add the open intents in new tab preference.
+ // Add the open intents in new tab column to the preferences table.
importDatabase.execSQL("ALTER TABLE " + PREFERENCES_TABLE + " ADD COLUMN " + OPEN_INTENTS_IN_NEW_TAB + " BOOLEAN");
- // Get the current open intents in new tab setting.
+ // Get the current open intents in new tab preference.
boolean openIntentsInNewTab = sharedPreferences.getBoolean(OPEN_INTENTS_IN_NEW_TAB, true);
// Populate the database with the current value.
} else {
importDatabase.execSQL("UPDATE " + PREFERENCES_TABLE + " SET " + OPEN_INTENTS_IN_NEW_TAB + " = " + 0);
}
+
+ // Upgrade from schema version 6.
+ case 6:
+ // Add the wide viewport column to the domains table.
+ importDatabase.execSQL("ALTER TABLE " + DomainsDatabaseHelper.DOMAINS_TABLE + " ADD COLUMN " + DomainsDatabaseHelper.WIDE_VIEWPORT + " INTEGER");
+
+ // Add the Google Analytics, Facebook Click IDs, Twitter AMP redirects, and wide viewport columns to the preferences table.
+ importDatabase.execSQL("ALTER TABLE " + PREFERENCES_TABLE + " ADD COLUMN " + GOOGLE_ANALYTICS + " BOOLEAN");
+ importDatabase.execSQL("ALTER TABLE " + PREFERENCES_TABLE + " ADD COLUMN " + FACEBOOK_CLICK_IDS + " BOOLEAN");
+ importDatabase.execSQL("ALTER TABLE " + PREFERENCES_TABLE + " ADD COLUMN " + TWITTER_AMP_REDIRECTS + " BOOLEAN");
+ importDatabase.execSQL("ALTER TABLE " + PREFERENCES_TABLE + " ADD COLUMN " + WIDE_VIEWPORT + " BOOLEAN");
+
+ // Get the current preference values.
+ boolean googleAnalytics = sharedPreferences.getBoolean(GOOGLE_ANALYTICS, true);
+ boolean facebookClickIds = sharedPreferences.getBoolean(FACEBOOK_CLICK_IDS, true);
+ boolean twitterAmpRedirects = sharedPreferences.getBoolean(TWITTER_AMP_REDIRECTS, true);
+ boolean wideViewport = sharedPreferences.getBoolean(WIDE_VIEWPORT, true);
+
+ // Populate the database with the current Google Analytics value.
+ if (googleAnalytics) {
+ importDatabase.execSQL("UPDATE " + PREFERENCES_TABLE + " SET " + GOOGLE_ANALYTICS + " = " + 1);
+ } else {
+ importDatabase.execSQL("UPDATE " + PREFERENCES_TABLE + " SET " + GOOGLE_ANALYTICS + " = " + 0);
+ }
+
+ // Populate the database with the current Facebook Click IDs value.
+ if (facebookClickIds) {
+ importDatabase.execSQL("UPDATE " + PREFERENCES_TABLE + " SET " + FACEBOOK_CLICK_IDS + " = " + 1);
+ } else {
+ importDatabase.execSQL("UPDATE " + PREFERENCES_TABLE + " SET " + FACEBOOK_CLICK_IDS + " = " + 0);
+ }
+
+ // Populate the database with the current Twitter AMP redirects value.
+ if (twitterAmpRedirects) {
+ importDatabase.execSQL("UPDATE " + PREFERENCES_TABLE + " SET " + TWITTER_AMP_REDIRECTS + " = " + 1);
+ } else {
+ importDatabase.execSQL("UPDATE " + PREFERENCES_TABLE + " SET " + TWITTER_AMP_REDIRECTS + " = " + 0);
+ }
+
+ // Populate the database with the current wide viewport value.
+ if (wideViewport) {
+ importDatabase.execSQL("UPDATE " + PREFERENCES_TABLE + " SET " + WIDE_VIEWPORT + " = " + 1);
+ } else {
+ importDatabase.execSQL("UPDATE " + PREFERENCES_TABLE + " SET " + WIDE_VIEWPORT + " = " + 0);
+ }
}
}
domainsContentValues.put(DomainsDatabaseHelper.FONT_SIZE, importDomainsCursor.getInt(importDomainsCursor.getColumnIndex(DomainsDatabaseHelper.FONT_SIZE)));
domainsContentValues.put(DomainsDatabaseHelper.SWIPE_TO_REFRESH, importDomainsCursor.getInt(importDomainsCursor.getColumnIndex(DomainsDatabaseHelper.SWIPE_TO_REFRESH)));
domainsContentValues.put(DomainsDatabaseHelper.NIGHT_MODE, importDomainsCursor.getInt(importDomainsCursor.getColumnIndex(DomainsDatabaseHelper.NIGHT_MODE)));
+ domainsContentValues.put(DomainsDatabaseHelper.WIDE_VIEWPORT, importDomainsCursor.getInt(importDomainsCursor.getColumnIndex(DomainsDatabaseHelper.WIDE_VIEWPORT)));
domainsContentValues.put(DomainsDatabaseHelper.DISPLAY_IMAGES, importDomainsCursor.getInt(importDomainsCursor.getColumnIndex(DomainsDatabaseHelper.DISPLAY_IMAGES)));
domainsContentValues.put(DomainsDatabaseHelper.PINNED_SSL_CERTIFICATE, importDomainsCursor.getInt(importDomainsCursor.getColumnIndex(DomainsDatabaseHelper.PINNED_SSL_CERTIFICATE)));
domainsContentValues.put(DomainsDatabaseHelper.SSL_ISSUED_TO_COMMON_NAME, importDomainsCursor.getString(importDomainsCursor.getColumnIndex(DomainsDatabaseHelper.SSL_ISSUED_TO_COMMON_NAME)));
.putBoolean(FANBOYS_SOCIAL_BLOCKING_LIST, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(FANBOYS_SOCIAL_BLOCKING_LIST)) == 1)
.putBoolean(ULTRAPRIVACY, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(ULTRAPRIVACY)) == 1)
.putBoolean(BLOCK_ALL_THIRD_PARTY_REQUESTS, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(BLOCK_ALL_THIRD_PARTY_REQUESTS)) == 1)
+ .putBoolean(GOOGLE_ANALYTICS, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(GOOGLE_ANALYTICS)) == 1)
+ .putBoolean(FACEBOOK_CLICK_IDS, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(FACEBOOK_CLICK_IDS)) == 1)
+ .putBoolean(TWITTER_AMP_REDIRECTS, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(TWITTER_AMP_REDIRECTS)) == 1)
.putBoolean(PROXY_THROUGH_ORBOT, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(PROXY_THROUGH_ORBOT)) == 1)
.putString(TOR_HOMEPAGE, importPreferencesCursor.getString(importPreferencesCursor.getColumnIndex(TOR_HOMEPAGE)))
.putString(TOR_SEARCH, importPreferencesCursor.getString(importPreferencesCursor.getColumnIndex(TOR_SEARCH)))
.putBoolean(DOWNLOAD_WITH_EXTERNAL_APP, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(DOWNLOAD_WITH_EXTERNAL_APP)) == 1)
.putBoolean(DARK_THEME, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(DARK_THEME)) == 1)
.putBoolean(NIGHT_MODE, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(NIGHT_MODE)) == 1)
+ .putBoolean(WIDE_VIEWPORT, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(WIDE_VIEWPORT)) == 1)
.putBoolean(DISPLAY_WEBPAGE_IMAGES, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(DISPLAY_WEBPAGE_IMAGES)) == 1)
.apply();
return exception.toString();
}
}
-}
+}
\ No newline at end of file
-<!-- `tab_disabled_light.xml` comes from the Android Material icon set, where it is called `tab`. It is released under the Apache License 2.0. -->
+<!-- `tab` comes from the Android Material icon set, where it is called `tab`. It is released under the Apache License 2.0. -->
<!-- `tools:ignore="VectorRaster"` removes the lint warning about `android:autoMirrored="true"` not applying to API < 21. -->
<vector
--- /dev/null
+<!-- `wide_viewport_disabled_dark.xml` comes from the Android Material icon set, where it is called `settings_overscan`. It is released under the Apache License 2.0. -->
+<vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:height="24dp"
+ android:width="24dp"
+ android:viewportHeight="24.0"
+ android:viewportWidth="24.0" >
+
+ <!-- A hard coded color must be used until the minimum API >= 21. Then `@color` can be used. -->
+ <path
+ android:fillColor="#FF9E9E9E"
+ android:pathData="M12.01,5.5L10,8h4l-1.99,-2.5zM18,10v4l2.5,-1.99L18,10zM6,10l-2.5,2.01L6,14v-4zM14,16h-4l2.01,2.5L14,16zM21,3L3,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h18c1.1,0 2,-0.9 2,-2L23,5c0,-1.1 -0.9,-2 -2,-2zM21,19.01L3,19.01L3,4.99h18v14.02z"/>
+</vector>
--- /dev/null
+<!-- `wide_viewport` comes from the Android Material icon set, where it is called `settings_overscan`. It is released under the Apache License 2.0. -->
+<vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:height="24dp"
+ android:width="24dp"
+ android:viewportHeight="24.0"
+ android:viewportWidth="24.0" >
+
+ <!-- A hard coded color must be used until the minimum API >= 21. Then `@color` can be used. -->
+ <path
+ android:fillColor="#FF757575"
+ android:pathData="M12.01,5.5L10,8h4l-1.99,-2.5zM18,10v4l2.5,-1.99L18,10zM6,10l-2.5,2.01L6,14v-4zM14,16h-4l2.01,2.5L14,16zM21,3L3,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h18c1.1,0 2,-0.9 2,-2L23,5c0,-1.1 -0.9,-2 -2,-2zM21,19.01L3,19.01L3,4.99h18v14.02z"/>
+</vector>
--- /dev/null
+<!-- `wide_viewport_enabled_dark.xml` comes from the Android Material icon set, where it is called `settings_overscan`. It is released under the Apache License 2.0. -->
+<vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:height="24dp"
+ android:width="24dp"
+ android:viewportHeight="24.0"
+ android:viewportWidth="24.0" >
+
+ <!-- A hard coded color must be used until the minimum API >= 21. Then `@color` can be used. -->
+ <path
+ android:fillColor="#FF1E88E5"
+ android:pathData="M12.01,5.5L10,8h4l-1.99,-2.5zM18,10v4l2.5,-1.99L18,10zM6,10l-2.5,2.01L6,14v-4zM14,16h-4l2.01,2.5L14,16zM21,3L3,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h18c1.1,0 2,-0.9 2,-2L23,5c0,-1.1 -0.9,-2 -2,-2zM21,19.01L3,19.01L3,4.99h18v14.02z"/>
+</vector>
--- /dev/null
+<!-- `wide_viewport_enabled_light.xml` comes from the Android Material icon set, where it is called `settings_overscan`. It is released under the Apache License 2.0. -->
+<vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:height="24dp"
+ android:width="24dp"
+ android:viewportHeight="24.0"
+ android:viewportWidth="24.0" >
+
+ <!-- A hard coded color must be used until the minimum API >= 21. Then `@color` can be used. -->
+ <path
+ android:fillColor="#FF1565C0"
+ android:pathData="M12.01,5.5L10,8h4l-1.99,-2.5zM18,10v4l2.5,-1.99L18,10zM6,10l-2.5,2.01L6,14v-4zM14,16h-4l2.01,2.5L14,16zM21,3L3,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h18c1.1,0 2,-0.9 2,-2L23,5c0,-1.1 -0.9,-2 -2,-2zM21,19.01L3,19.01L3,4.99h18v14.02z"/>
+</vector>
android:textSize="13sp" />
</LinearLayout>
+ <!-- Wide Viewport. -->
+ <LinearLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ android:layout_marginTop="14dp"
+ android:layout_marginBottom="14dp" >
+
+ <LinearLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="horizontal" >
+
+ <ImageView
+ android:id="@+id/wide_viewport_imageview"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_marginTop="1dp"
+ android:layout_marginEnd="10dp"
+ android:layout_gravity="center_vertical"
+ android:contentDescription="@string/wide_viewport" />
+
+ <Spinner
+ android:id="@+id/wide_viewport_spinner"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" />
+ </LinearLayout>
+
+ <TextView
+ android:id="@+id/wide_viewport_textview"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:layout_marginStart="45dp"
+ android:layout_marginEnd="36dp"
+ android:textSize="13sp" />
+ </LinearLayout>
+
<!-- Display Images. -->
<LinearLayout
android:layout_height="wrap_content"
android:checkable="true"
app:showAsAction="never" />
+ <item
+ android:id="@+id/wide_viewport"
+ android:title="@string/wide_viewport"
+ android:orderInCategory="950"
+ android:checkable="true"
+ app:showAsAction="never" />
+
<item
android:id="@+id/display_images"
android:title="@string/display_images"
- android:orderInCategory="950"
+ android:orderInCategory="960"
android:checkable="true"
app:showAsAction="never" />
<item
android:id="@+id/night_mode"
android:title="@string/options_night_mode"
- android:orderInCategory="960"
+ android:orderInCategory="970"
android:checkable="true"
app:showAsAction="never" />
<item
android:id="@+id/find_on_page"
android:title="@string/find_on_page"
- android:orderInCategory="970"
+ android:orderInCategory="980"
app:showAsAction="never|collapseActionView" />
<item
android:id="@+id/view_source"
android:title="@string/view_source"
- android:orderInCategory="980"
+ android:orderInCategory="990"
app:showAsAction="never" />
</menu>
</item>
<string name="ultraprivacy_summary">UltraPrivacy blockiert Tracker, die von EasyPrivacy nicht blockiert werden, da dies Webseiten verunstalten kann.</string>
<string name="block_all_third_party_requests">Alle Zugriffe auf Dritt-Anbieter-Inhalte blockieren</string>
<string name="block_all_third_party_requests_summary">Alle Zugriffe auf Dritt-Anbieter-Inhalte zu blockieren verbessert die Privatsphäre, kann jedoch Webseiten verunstalten.</string>
+ <string name="url_modification">URL-Bereinigung</string>
+ <string name="google_analytics">Google Analytics</string>
+ <string name="google_analytics_summary">Entfernt “?utm_” oder “&utm_” sowie alles danach aus URLs.</string>
+ <string name="facebook_click_ids">Facebook Click-IDs</string>
+ <string name="facebook_click_ids_summary">Entfernt “?fbclid=” or “&fbclid=” sowie alles danach aus URLs.</string>
+ <string name="twitter_amp_redirects">Twitter AMP-Umleitungen</string>
+ <string name="twitter_amp_redirects_summary">Entfernt “?amp=1” sowie alles danach URLs.</string>
<string name="tor">Tor</string>
<string name="proxy_through_orbot">Proxy durch Orbot</string>
<string name="proxy_through_orbot_summary">Sämtlichen Web-Verkehr durch Orbot mittels localhost:8118 leiten.</string>
<string name="ultraprivacy_summary">Ultra Privacidad bloquea los rastreadores que no bloquea EasyPrivacy, porque al hacerlo puede romper páginas web.</string>
<string name="block_all_third_party_requests">Bloquear todas las solicitudes de terceras partes</string>
<string name="block_all_third_party_requests_summary">Bloquear todas las solicitudes de terceras partes aumenta la privacidad, pero rompe muchas páginas web.</string>
+ <string name="url_modification">Modificación de URL</string>
+ <string name="google_analytics">Google Analytics</string>
+ <string name="google_analytics_summary">Eliminar “?utm_” o “&utm_” y cualquier cosa después de esto de las URLs.</string>
+ <string name="facebook_click_ids">IDs de clics en Facebook</string>
+ <string name="facebook_click_ids_summary">Eliminar “?fbclid=” o “&fbclid=” y cualquier cosa después de esto de las URLs.</string>
+ <string name="twitter_amp_redirects">Redirecciones de Twitter AMP</string>
+ <string name="twitter_amp_redirects_summary">Eliminar “?amp=1” y cualquier cosa después de esto de las URLs.</string>
<string name="tor">Tor</string>
<string name="proxy_through_orbot">Enviar a través de Orbot</string>
<string name="proxy_through_orbot_summary">Enviar todo el tráfico web a través de Orbot en localhost:8118.</string>
<string name="ultraprivacy_summary">L\'UltraPrivacy blocca i tracciamenti che EasyPrivacy ignora perché potrebbero impedire la visualizzazione dei siti web.</string>
<string name="block_all_third_party_requests">Blocca tutte le richieste di Terze Parti</string>
<string name="block_all_third_party_requests_summary">Il blocco di tutte le richieste di Terze Parti aumenta privacy, ma impedisce la visualizzazione di molti siti web.</string>
+ <string name="url_modification">Modifica delle URL</string>
+ <string name="google_analytics">Google Analytics</string>
+ <string name="google_analytics_summary">Rimuovi “?utm_” o “&utm_” e tutto quello che segue dalle URL.</string>
+ <string name="facebook_click_ids">Facebook Click ID</string>
+ <string name="facebook_click_ids_summary">Rimuovi “?fbclid=” o “&fbclid=” e tutto quello che segue dalle URL.</string>
+ <string name="twitter_amp_redirects">Reindirizzamenti Twitter AMP</string>
+ <string name="twitter_amp_redirects_summary">Rimuovi “?amp=1” e tutto quello che segue dalle URL.</string>
<string name="tor">Tor</string>
<string name="proxy_through_orbot">Utilizza Proxy con Orbot</string>
<string name="proxy_through_orbot_summary">Utilizza Proxy attraverso Orbot su localhost:8118.</string>
<string name="one_hundred_seventy_five_percent">175%</string>
<string name="two_hundred_percent">200%</string>
<string name="swipe_to_refresh_options_menu">Swipe to Refresh</string>
+ <string name="wide_viewport">Wide Viewport</string>
<string name="display_images">Display Images</string>
<string name="options_night_mode">Night Mode</string>
<string name="view_source">View Source</string>
<item>Night mode enabled</item>
<item>Night mode disabled</item>
</string-array>
+ <string-array name="wide_viewport_array">
+ <item>System default</item>
+ <item>Wide viewport enabled</item>
+ <item>Wide viewport disabled</item>
+ </string-array>
<string-array name="display_webpage_images_array">
<item>System default</item>
<item>Images enabled</item>
<string name="dark_theme_summary">Changing the theme will restart Privacy Browser.</string>
<string name="night_mode">Night mode</string>
<string name="night_mode_summary">Enabling night mode will also enable JavaScript for all web pages.</string>
+ <string name="wide_viewport_preference">Wide viewport</string>
+ <string name="wide_viewport_summary">Using a wide viewport makes some webpages layout more like the desktop site.</string>
<string name="display_webpage_images">Display webpage images</string>
<string name="display_webpage_images_summary">Disable to conserve bandwidth.</string>
android:summary="@string/night_mode_summary"
android:defaultValue="false" />
+ <SwitchPreference
+ android:key="wide_viewport"
+ android:title="@string/wide_viewport_preference"
+ android:summary="@string/wide_viewport_summary"
+ android:defaultValue="true" />
+
<SwitchPreference
android:key="display_webpage_images"
android:title="@string/display_webpage_images"