diff --git a/src/plugins/openInApp/index.ts b/src/plugins/openInApp/index.ts index 9fd335bd..e26a01eb 100644 --- a/src/plugins/openInApp/index.ts +++ b/src/plugins/openInApp/index.ts @@ -53,10 +53,10 @@ export default definePlugin({ patches: [ { - find: '"MaskedLinkStore"', + find: "trackAnnouncementMessageLinkClicked({", replacement: { - match: /return ((\i)\.apply\(this,arguments\))(?=\}function \i.{0,250}\.trusted)/, - replace: "return $self.handleLink(...arguments).then(handled => handled||$1)" + match: /(?<=handleClick:function\(\)\{return (\i)\}.+?)async function \1\(.+?\)\{/, + replace: "$& if(await $self.handleLink(...arguments)) return;" } }, // Make Spotify profile activity links open in app on web @@ -71,7 +71,7 @@ export default definePlugin({ { find: ".CONNECTED_ACCOUNT_VIEWED,", replacement: { - match: /(?<=href:\i,onClick:function\(\i\)\{)(?=\i=(\i)\.type,.{0,50}CONNECTED_ACCOUNT_VIEWED)/, + match: /(?<=href:\i,onClick:\i=>\{)(?=.{0,10}\i=(\i)\.type,.{0,100}CONNECTED_ACCOUNT_VIEWED)/, replace: "$self.handleAccountView(arguments[0],$1.type,$1.id);" } }