// It is also used in `onCreate()`, `onCreateOptionsMenu()`, `onPrepareOptionsMenu()`, and `onOptionsItemSelected()`.
public static boolean firstPartyCookiesEnabled;
- // `thridPartyCookiesEnables` is public static so it can be accessed from `SettingsFragment`.
+ // `thirdPartyCookiesEnables` is public static so it can be accessed from `SettingsFragment`.
// It is also used in `onCreate()`, `onCreateOptionsMenu()`, `onPrepareOptionsMenu()`, and `onOptionsItemSelected()`.
public static boolean thirdPartyCookiesEnabled;
// `swipeToRefreshEnabled` is public static so it can be accessed from `SettingsFragment`. It is also used in `onCreate()`.
public static boolean swipeToRefreshEnabled;
- // `customHeader` is public static so it can be accessed from `BookmarksActivity`. It is also used in `onCreate()` and `loadUrlFromTextBox()`.
+ // `customHeader` is public static so it can be accessed from `BookmarksActivity`. It is also used in `onCreate()`, `onOptionsItemSelected()`, and `loadUrlFromTextBox()`.
public static Map<String, String> customHeaders = new HashMap<String, String>();
// drawerToggle creates the hamburger icon at the start of the AppBar.
drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, supportAppBar, R.string.open_navigation, R.string.close_navigation);
- // Replace the header that `WebView` creates for `X-Requested-With` with a null value. The default value is the application ID (com.stoutner.privacybrowser.standard).
- customHeaders.put("X-Requested-With", "");
-
mainWebView.setWebViewClient(new WebViewClient() {
// shouldOverrideUrlLoading makes this `WebView` the default handler for URLs inside the app, so that links are not kicked out to other apps.
@Override
swipeToRefresh.setEnabled(swipeToRefreshEnabled);
+ // Replace the header that `WebView` creates for `X-Requested-With` with a null value. The default value is the application ID (com.stoutner.privacybrowser.standard).
+ customHeaders.put("X-Requested-With", "");
+
+ // Set Do Not Track. The default is true.
+ if (sharedPreferences.getBoolean("do_not_track", true)) {
+ customHeaders.put("DNT", "1");
+ }
+
+
// Get the intent information that started the app.
final Intent intent = getIntent();
// Clear `formattedUrlString`.
formattedUrlString = null;
+ // Clear `customHeaders`.
+ customHeaders.clear();
+
// Destroy the internal state of the webview.
mainWebView.destroy();