diff --git a/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt b/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt index 7686a84c..cd320060 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt @@ -150,7 +150,11 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener { * @return true if the str has launched an app task (be it successful or not) * @param isWebview does not handle providers and opening download page if true. Can still add repos and login. * */ - fun handleAppIntentUrl(activity: FragmentActivity?, str: String?, isWebview: Boolean): Boolean = + fun handleAppIntentUrl( + activity: FragmentActivity?, + str: String?, + isWebview: Boolean + ): Boolean = with(activity) { if (str != null && this != null) { if (str.startsWith("https://cs.repo")) { @@ -191,7 +195,7 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener { val url = str.replaceFirst(appStringRepo, "https") loadRepository(url) return true - } else if (!isWebview){ + } else if (!isWebview) { if (str.startsWith(DOWNLOAD_NAVIGATE_TO)) { this.navigate(R.id.navigation_downloads) return true @@ -565,9 +569,7 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener { for (api in accountManagers) { api.init() } - } - ioSafe { inAppAuths.apmap { api -> try { api.initialize() diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/WebviewFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/WebviewFragment.kt index fbc055a8..19e24f74 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/WebviewFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/WebviewFragment.kt @@ -40,13 +40,15 @@ class WebviewFragment : Fragment() { return super.shouldOverrideUrlLoading(view, request) } } + + WebViewResolver.webViewUserAgent = web_view.settings.userAgentString + web_view.addJavascriptInterface(RepoApi(activity), "RepoApi") web_view.settings.javaScriptEnabled = true web_view.settings.userAgentString = USER_AGENT web_view.settings.domStorageEnabled = true +// WebView.setWebContentsDebuggingEnabled(true) - WebViewResolver.webViewUserAgent = web_view.settings.userAgentString -// web_view.settings.userAgentString = USER_AGENT web_view.loadUrl(url) }