Skip to content

Commit

Permalink
Merge pull request #315 from hotwired/webview-id
Browse files Browse the repository at this point in the history
Assign a unique view ID to each WebView instance
  • Loading branch information
jayohms authored Feb 26, 2024
2 parents 3eb0086 + 8c3a5e1 commit db582ed
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions turbo/src/main/kotlin/dev/hotwire/turbo/views/TurboWebView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package dev.hotwire.turbo.views
import android.annotation.SuppressLint
import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.webkit.WebView
import android.widget.FrameLayout
import android.widget.FrameLayout.LayoutParams.MATCH_PARENT
Expand All @@ -25,6 +26,7 @@ open class TurboWebView @JvmOverloads constructor(context: Context, attrs: Attri
private val gson = GsonBuilder().disableHtmlEscaping().create()

init {
id = View.generateViewId()
settings.javaScriptEnabled = true
settings.domStorageEnabled = true
settings.setSupportMultipleWindows(true)
Expand Down

0 comments on commit db582ed

Please sign in to comment.