dont forward custom tab long presses
This commit is contained in:
+5
@@ -25,6 +25,7 @@ import mozilla.components.browser.state.action.LastAccessAction
|
||||
import mozilla.components.browser.state.action.ReaderAction
|
||||
import mozilla.components.browser.state.action.TabListAction
|
||||
import mozilla.components.browser.state.action.WebExtensionAction
|
||||
import mozilla.components.browser.state.selector.findCustomTab
|
||||
import mozilla.components.browser.state.state.BrowserState
|
||||
import mozilla.components.concept.engine.HitResult
|
||||
import mozilla.components.feature.addons.logger
|
||||
@@ -93,6 +94,9 @@ class FlutterEventMiddleware(private val flutterEvents: GeckoStateEvents) : Midd
|
||||
}
|
||||
}
|
||||
is ContentAction.UpdateHitResultAction -> {
|
||||
// Skip forwarding to Flutter for custom tab sessions (PWAs, TWAs),
|
||||
// as they handle context menus natively via ContextMenuFeature
|
||||
if (store.state.findCustomTab(action.sessionId) == null) {
|
||||
runOnUiThread {
|
||||
flutterEvents.onLongPress(
|
||||
EventSequence.next(),
|
||||
@@ -110,6 +114,7 @@ class FlutterEventMiddleware(private val flutterEvents: GeckoStateEvents) : Midd
|
||||
) { _ -> }
|
||||
}
|
||||
}
|
||||
}
|
||||
is ContentAction.AddFindResultAction -> {
|
||||
runOnUiThread {
|
||||
flutterEvents.onFindResults(
|
||||
|
||||
Reference in New Issue
Block a user