X-Git-Url: https://gitweb.stoutner.com/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Ffragments%2FGuideWebViewFragment.kt;h=5c8425cc328d34861515075e4246f8a77af83969;hb=514e93baaa8389dc9c5abdb79e68c890c260b8d3;hp=e572a63446aadf5483b33a7b802167d81778161a;hpb=a156c3942ca31a1afca3271245cc2bda7ed5aed8;p=PrivacyBrowserAndroid.git diff --git a/app/src/main/java/com/stoutner/privacybrowser/fragments/GuideWebViewFragment.kt b/app/src/main/java/com/stoutner/privacybrowser/fragments/GuideWebViewFragment.kt index e572a634..5c8425cc 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/fragments/GuideWebViewFragment.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/fragments/GuideWebViewFragment.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2016-2022 Soren Stoutner . + * Copyright 2016-2023 Soren Stoutner . * * This file is part of Privacy Browser Android . * @@ -21,7 +21,6 @@ package com.stoutner.privacybrowser.fragments import android.content.Intent import android.content.res.Configuration -import android.net.Uri import android.os.Build import android.os.Bundle import android.view.LayoutInflater @@ -90,14 +89,13 @@ class GuideWebViewFragment : Fragment() { // Set a WebView client. tabWebView.webViewClient = object : WebViewClient() { - // Send external links back to the main Privacy Browser WebView. The deprecated `shouldOverrideUrlLoading` must be used until API >= 24. - @Deprecated("Deprecated in Java") - override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean { + // Send external links back to the main Privacy Browser WebView. + override fun shouldOverrideUrlLoading(view: WebView, webResourceRequest: WebResourceRequest): Boolean { // Create an intent to view the URL. val urlIntent = Intent(Intent.ACTION_VIEW) // Add the URL to the intent. - urlIntent.data = Uri.parse(url) + urlIntent.data = webResourceRequest.url // Make it so. startActivity(urlIntent) @@ -134,6 +132,7 @@ class GuideWebViewFragment : Fragment() { 6 -> tabWebView.loadUrl("https://appassets.androidplatform.net/assets/" + getString(R.string.android_asset_path) + "/guide_ssl_certificates.html") 7 -> tabWebView.loadUrl("https://appassets.androidplatform.net/assets/" + getString(R.string.android_asset_path) + "/guide_proxies.html") 8 -> tabWebView.loadUrl("https://appassets.androidplatform.net/assets/" + getString(R.string.android_asset_path) + "/guide_tracking_ids.html") + 9 -> tabWebView.loadUrl("https://appassets.androidplatform.net/assets/" + getString(R.string.android_asset_path) + "/guide_interface.html") } // Scroll the WebView if the saved instance state is not null. @@ -159,4 +158,4 @@ class GuideWebViewFragment : Fragment() { savedInstanceState.putInt(SCROLL_Y, tabWebView.scrollY) } } -} \ No newline at end of file +}