diff --git a/widget/android/AndroidContentController.cpp b/widget/android/AndroidContentController.cpp index e10a98056dad..fb3f305bf5f9 100644 --- a/widget/android/AndroidContentController.cpp +++ b/widget/android/AndroidContentController.cpp @@ -70,9 +70,17 @@ AndroidContentController::HandleSingleTap(const CSSPoint& aPoint, } CSSIntPoint rounded = RoundedToInt(point); - nsCString data = nsPrintfCString("{ \"x\": %d, \"y\": %d }", rounded.x, rounded.y); - nsAppShell::PostEvent(AndroidGeckoEvent::MakeBroadcastEvent( - NS_LITERAL_CSTRING("Gesture:SingleTap"), data)); + nsAppShell::PostEvent([rounded] { + nsCOMPtr obsServ = + mozilla::services::GetObserverService(); + if (!obsServ) { + return; + } + + nsPrintfCString data("{\"x\":%d,\"y\":%d}", rounded.x, rounded.y); + obsServ->NotifyObservers(nullptr, "Gesture:SingleTap", + NS_ConvertASCIItoUTF16(data).get()); + }); } ChromeProcessController::HandleSingleTap(aPoint, aModifiers, aGuid);