From a6a789de829154cbe3036e58721c2cefa7ca7476 Mon Sep 17 00:00:00 2001 From: Moti Zilberman Date: Mon, 2 Jun 2025 09:40:03 +0100 Subject: [PATCH] Expose API for selectively overriding frontend host methods --- front_end/core/host/InspectorFrontendHost.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/front_end/core/host/InspectorFrontendHost.ts b/front_end/core/host/InspectorFrontendHost.ts index 7f3921d8a0a5..bfa93f566e4d 100644 --- a/front_end/core/host/InspectorFrontendHost.ts +++ b/front_end/core/host/InspectorFrontendHost.ts @@ -609,6 +609,12 @@ function initializeInspectorFrontendHost(): void { // Attach the events object. InspectorFrontendHostInstance.events = new Common.ObjectWrapper.ObjectWrapper(); + + // @ts-ignore Global injected by the React Native DevTools shell. + const {reactNativeDecorateInspectorFrontendHostInstance} = globalThis; + if (typeof reactNativeDecorateInspectorFrontendHostInstance === 'function') { + reactNativeDecorateInspectorFrontendHostInstance(InspectorFrontendHostInstance); + } } // FIXME: This file is included into both apps, since the devtools_app needs the InspectorFrontendHostAPI only,