Skip to content

Commit bd84ff0

Browse files
committed
Reload script before page reload when changing protection status
1 parent 43e14eb commit bd84ff0

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1935,11 +1935,17 @@ class BrowserTabFragment :
19351935
is Command.ShowFireproofWebSiteConfirmation -> fireproofWebsiteConfirmation(it.fireproofWebsiteEntity)
19361936
is Command.DeleteFireproofConfirmation -> removeFireproofWebsiteConfirmation(it.fireproofWebsiteEntity)
19371937
is Command.RefreshAndShowPrivacyProtectionEnabledConfirmation -> {
1938+
webView?.let {
1939+
webViewClient.configureWebView(it, null)
1940+
}
19381941
refresh()
19391942
privacyProtectionEnabledConfirmation(it.domain)
19401943
}
19411944

19421945
is Command.RefreshAndShowPrivacyProtectionDisabledConfirmation -> {
1946+
webView?.let {
1947+
webViewClient.configureWebView(it, null)
1948+
}
19431949
refresh()
19441950
privacyProtectionDisabledConfirmation(it.domain)
19451951
}

app/src/main/java/com/duckduckgo/app/browser/BrowserWebViewClient.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,9 +470,9 @@ class BrowserWebViewClient @Inject constructor(
470470
}
471471

472472
fun configureWebView(webView: DuckDuckGoWebView, callback: WebViewCompatMessageCallback) {
473-
addDocumentStartJavascriptPlugins.getPlugins().forEach { plugin ->
474-
plugin.addDocumentStartJavaScript(webView)
475-
}
473+
addDocumentStartJavascriptPlugins.getPlugins().forEach { plugin ->
474+
plugin.addDocumentStartJavaScript(webView)
475+
}
476476

477477
webMessagingPlugins.getPlugins().forEach { plugin ->
478478
plugin.register(callback, webView)

0 commit comments

Comments
 (0)