diff --git a/src/plugins/pictureInPicture/index.tsx b/src/plugins/pictureInPicture/index.tsx index 6112d9c4f..1d75319a8 100644 --- a/src/plugins/pictureInPicture/index.tsx +++ b/src/plugins/pictureInPicture/index.tsx @@ -30,8 +30,8 @@ export default definePlugin({ { find: ".removeMosaicItemHoverButton),", replacement: { - match: /\.nonMediaMosaicItem\]:.{0,40}children:\i.slice\(\i\)(?<=showDownload:(\i).+?isVisualMediaType:(\i).+?)/, - replace: (m, showDownload, isVisualMediaType) => `${m}.unshift(${showDownload}&&${isVisualMediaType}&&$self.PictureInPictureButton())` + match: /(\.nonMediaMosaicItem\]:.{0,40}children:)(\i.slice\(\i\))(?<=showDownload:(\i).+?isVisualMediaType:(\i).+?)/, + replace: (_, rest, origChildren, showDownload, isVisualMediaType) => `${rest}[${showDownload}&&${isVisualMediaType}&&$self.PictureInPictureButton(),...${origChildren}]` } } ],