Skip to content

Commit 00efc0a

Browse files
huntiemeta-codesync[bot]
authored andcommitted
Promote fuseboxScreenshotCaptureEnabled to stable (#57540)
Summary: Pull Request resolved: #57540 This feature is fully implemented, stable, and isolated — enable for all. See also react/react-native-devtools-frontend#252. Changelog: [General][Added] - **React Native DevTools**: Users and agents can now capture app screenshots via the `Page.captureScreenshot` command Reviewed By: GijsWeterings Differential Revision: D111894234 fbshipit-source-id: eaab5cb00c1a922961382dd64f616c7bf215032f
1 parent 47fad09 commit 00efc0a

7 files changed

Lines changed: 16 additions & 18 deletions

File tree

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<a31073b853e102dfad7558805194f5a3>>
7+
* @generated SignedSource<<8a117541421f413e517e1be1acf8be7d>>
88
*/
99

1010
/**
@@ -141,7 +141,7 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
141141

142142
override fun fuseboxNetworkInspectionEnabled(): Boolean = true
143143

144-
override fun fuseboxScreenshotCaptureEnabled(): Boolean = false
144+
override fun fuseboxScreenshotCaptureEnabled(): Boolean = true
145145

146146
override fun fuseboxWebSocketEventsEnabled(): Boolean = false
147147

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Experimental_Android.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<af67163b6d34bb714b783658501ca6e8>>
7+
* @generated SignedSource<<41f83a9921de88f659ddc22172344226>>
88
*/
99

1010
/**
@@ -31,8 +31,6 @@ public open class ReactNativeFeatureFlagsOverrides_RNOSS_Experimental_Android :
3131

3232
override fun fuseboxFrameRecordingEnabled(): Boolean = true
3333

34-
override fun fuseboxScreenshotCaptureEnabled(): Boolean = true
35-
3634
override fun preventShadowTreeCommitExhaustion(): Boolean = true
3735

3836
override fun useSharedAnimatedBackend(): Boolean = true

packages/react-native/ReactCommon/jsinspector-modern/tests/HostTargetTest.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,11 +1632,15 @@ TEST_F(HostTargetTest, TracingDelegateIsNotifiedOnDirectTracingCall) {
16321632
page_->stopTracing();
16331633
}
16341634

1635-
TEST_F(HostTargetProtocolTest, CaptureScreenshotNotSupportedWhenFlagDisabled) {
1635+
TEST_F(HostTargetProtocolTest, CaptureScreenshotReturnsData) {
1636+
EXPECT_CALL(hostTargetDelegate_, captureScreenshot(_))
1637+
.WillOnce(Return(std::optional<std::string>("c2NyZWVuc2hvdA==")))
1638+
.RetiresOnSaturation();
16361639
EXPECT_CALL(
16371640
fromPage(),
16381641
onMessage(JsonParsed(AllOf(
1639-
AtJsonPtr("/error/code", Eq(-32601)), AtJsonPtr("/id", Eq(1))))))
1642+
AtJsonPtr("/id", Eq(1)),
1643+
AtJsonPtr("/result/data", Eq("c2NyZWVuc2hvdA=="))))))
16401644
.RetiresOnSaturation();
16411645
toPage_->sendMessage(R"({
16421646
"id": 1,

packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<2e19fd4b007d0ae7397babcc605b5783>>
7+
* @generated SignedSource<<96887197bdbba2c13e11046b73572e56>>
88
*/
99

1010
/**
@@ -264,7 +264,7 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
264264
}
265265

266266
bool fuseboxScreenshotCaptureEnabled() override {
267-
return false;
267+
return true;
268268
}
269269

270270
bool fuseboxWebSocketEventsEnabled() override {

packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSExperimental.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<bcd31ae20312c38ff0bbc8fdeac5ce36>>
7+
* @generated SignedSource<<630f900c13eb68232717fc28528253e2>>
88
*/
99

1010
/**
@@ -43,10 +43,6 @@ class ReactNativeFeatureFlagsOverridesOSSExperimental : public ReactNativeFeatur
4343
return true;
4444
}
4545

46-
bool fuseboxScreenshotCaptureEnabled() override {
47-
return true;
48-
}
49-
5046
bool preventShadowTreeCommitExhaustion() override {
5147
return true;
5248
}

packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,15 +680,15 @@ const definitions: FeatureFlagDefinitions = {
680680
ossReleaseStage: 'none',
681681
},
682682
fuseboxScreenshotCaptureEnabled: {
683-
defaultValue: false,
683+
defaultValue: true,
684684
metadata: {
685685
dateAdded: '2026-04-01',
686686
description:
687687
'Enable Page.captureScreenshot CDP method support in the React Native DevTools CDP backend. This flag is global and should not be changed across React Host lifetimes.',
688688
expectedReleaseValue: true,
689689
purpose: 'experimentation',
690690
},
691-
ossReleaseStage: 'experimental',
691+
ossReleaseStage: 'stable',
692692
},
693693
fuseboxWebSocketEventsEnabled: {
694694
defaultValue: false,

packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<040d7a7365dfe19ee8721892e5e5551d>>
7+
* @generated SignedSource<<cfeef081e12018ec3cb6f9d76049ce5e>>
88
* @flow strict
99
* @noformat
1010
*/
@@ -445,7 +445,7 @@ export const fuseboxNetworkInspectionEnabled: Getter<boolean> = createNativeFlag
445445
/**
446446
* Enable Page.captureScreenshot CDP method support in the React Native DevTools CDP backend. This flag is global and should not be changed across React Host lifetimes.
447447
*/
448-
export const fuseboxScreenshotCaptureEnabled: Getter<boolean> = createNativeFlagGetter('fuseboxScreenshotCaptureEnabled', false);
448+
export const fuseboxScreenshotCaptureEnabled: Getter<boolean> = createNativeFlagGetter('fuseboxScreenshotCaptureEnabled', true);
449449
/**
450450
* Enable reporting of WebSocket network events (`Network.webSocket*` CDP events) to the React Native DevTools CDP backend. Requires `fuseboxNetworkInspectionEnabled`.
451451
*/

0 commit comments

Comments
 (0)