File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -238,9 +238,10 @@ export function HostedBrowserWebview(props: {
238238
239239 if ( ! config ) return null ;
240240
241+ const renderingActive = active || backgroundActivity || pictureInPicture || recordingActive ;
241242 const wrapperStyle = resolveHostedBrowserWebviewWrapperStyle ( {
242243 active,
243- renderingActive : active || backgroundActivity || pictureInPicture || recordingActive ,
244+ renderingActive,
244245 cornerRadius : presentation . cornerRadius ,
245246 rect : lastRect ,
246247 hiddenSize,
@@ -252,6 +253,7 @@ export function HostedBrowserWebview(props: {
252253 className = "fixed overflow-hidden bg-muted/35"
253254 style = { { ...wrapperStyle , overscrollBehavior : "contain" } }
254255 onScroll = { syncContentPresentation }
256+ data-preview-rendering = { renderingActive ? "active" : "suspended" }
255257 data-preview-viewport = { runtimeTabId }
256258 >
257259 < div className = "relative" style = { { width : layout . canvasWidth , height : layout . canvasHeight } } >
Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ const findPreviewWebview = (tabId: string): ExecutablePreviewWebview | null =>
126126
127127const isPreviewWebviewRendering = ( runtimeTabId : string ) : boolean => {
128128 const wrapper = findPreviewWebview ( runtimeTabId ) ?. closest < HTMLElement > ( "[data-preview-viewport]" ) ;
129- return wrapper !== null && wrapper !== undefined && wrapper . style . visibility !== "hidden ";
129+ return wrapper ?. getAttribute ( "data-preview-rendering" ) === "active ";
130130} ;
131131
132132const readWebviewViewport = async (
You can’t perform that action at this time.
0 commit comments