mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-04-30 05:54:26 +02:00
im very good at this
This commit is contained in:
parent
56ff299fa0
commit
afb8c26bf2
@ -184,9 +184,7 @@ public abstract interface class app/revanced/manager/plugin/downloader/webview/W
|
|||||||
public final class app/revanced/manager/plugin/downloader/webview/WebViewScope : app/revanced/manager/plugin/downloader/Scope {
|
public final class app/revanced/manager/plugin/downloader/webview/WebViewScope : app/revanced/manager/plugin/downloader/Scope {
|
||||||
public final fun download (Lkotlin/jvm/functions/Function5;)V
|
public final fun download (Lkotlin/jvm/functions/Function5;)V
|
||||||
public fun getHostPackageName ()Ljava/lang/String;
|
public fun getHostPackageName ()Ljava/lang/String;
|
||||||
public final fun getJsEnabled ()Z
|
|
||||||
public fun getPluginPackageName ()Ljava/lang/String;
|
public fun getPluginPackageName ()Ljava/lang/String;
|
||||||
public final fun pageLoad (Lkotlin/jvm/functions/Function3;)V
|
public final fun pageLoad (Lkotlin/jvm/functions/Function3;)V
|
||||||
public final fun setJsEnabled (Z)V
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package app.revanced.manager.plugin.downloader.webview
|
package app.revanced.manager.plugin.downloader.webview
|
||||||
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
|
||||||
import app.revanced.manager.plugin.downloader.DownloadUrl
|
import app.revanced.manager.plugin.downloader.DownloadUrl
|
||||||
import app.revanced.manager.plugin.downloader.DownloaderScope
|
import app.revanced.manager.plugin.downloader.DownloaderScope
|
||||||
import app.revanced.manager.plugin.downloader.GetScope
|
import app.revanced.manager.plugin.downloader.GetScope
|
||||||
@ -45,12 +44,6 @@ class WebViewScope<T> internal constructor(
|
|||||||
private lateinit var webView: IWebView
|
private lateinit var webView: IWebView
|
||||||
internal lateinit var initialUrl: String
|
internal lateinit var initialUrl: String
|
||||||
|
|
||||||
/**
|
|
||||||
* Controls whether JavaScript is enabled in the WebView. The default value is false.
|
|
||||||
* Changing this after the WebView has been launched has no effect.
|
|
||||||
*/
|
|
||||||
var jsEnabled = false
|
|
||||||
|
|
||||||
internal val binder = object : IWebViewEvents.Stub() {
|
internal val binder = object : IWebViewEvents.Stub() {
|
||||||
override fun ready(iface: IWebView?) {
|
override fun ready(iface: IWebView?) {
|
||||||
coroutineScope.launch(dispatcher) {
|
coroutineScope.launch(dispatcher) {
|
||||||
@ -128,7 +121,7 @@ suspend fun <T> GetScope.runWebView(
|
|||||||
requestStartActivity(Intent().apply {
|
requestStartActivity(Intent().apply {
|
||||||
putExtra(
|
putExtra(
|
||||||
WebViewActivity.KEY,
|
WebViewActivity.KEY,
|
||||||
WebViewActivity.Parameters(title, scope.jsEnabled, scope.binder)
|
WebViewActivity.Parameters(title, scope.binder)
|
||||||
)
|
)
|
||||||
setClassName(
|
setClassName(
|
||||||
hostPackageName,
|
hostPackageName,
|
||||||
|
@ -41,7 +41,7 @@ class WebViewActivity : ComponentActivity() {
|
|||||||
}
|
}
|
||||||
val params = intent.getParcelableExtra<Parameters>(KEY)!!
|
val params = intent.getParcelableExtra<Parameters>(KEY)!!
|
||||||
actionBar?.apply {
|
actionBar?.apply {
|
||||||
title = intent.getStringExtra(params.title)
|
title = params.title
|
||||||
setHomeAsUpIndicator(android.R.drawable.ic_menu_close_clear_cancel)
|
setHomeAsUpIndicator(android.R.drawable.ic_menu_close_clear_cancel)
|
||||||
setDisplayHomeAsUpEnabled(true)
|
setDisplayHomeAsUpEnabled(true)
|
||||||
}
|
}
|
||||||
@ -55,7 +55,7 @@ class WebViewActivity : ComponentActivity() {
|
|||||||
databaseEnabled = false
|
databaseEnabled = false
|
||||||
allowContentAccess = false
|
allowContentAccess = false
|
||||||
domStorageEnabled = false
|
domStorageEnabled = false
|
||||||
javaScriptEnabled = params.jsEnabled
|
javaScriptEnabled = true
|
||||||
}
|
}
|
||||||
|
|
||||||
webViewClient = vm.webViewClient
|
webViewClient = vm.webViewClient
|
||||||
@ -88,7 +88,7 @@ class WebViewActivity : ComponentActivity() {
|
|||||||
|
|
||||||
@Parcelize
|
@Parcelize
|
||||||
internal class Parameters(
|
internal class Parameters(
|
||||||
val title: String, val jsEnabled: Boolean, val events: IBinder
|
val title: String, val events: IBinder
|
||||||
) : Parcelable
|
) : Parcelable
|
||||||
|
|
||||||
internal companion object {
|
internal companion object {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user