partytown icon indicating copy to clipboard operation
partytown copied to clipboard

feat: add return value hook

Open emilisb opened this issue 2 years ago • 3 comments

Add a new hook for intercepting return value. Can be used to modify return value or prevent an object from being returned.

        returnValue(opts) {
          if (opts.nodeName === '#document' && opts.name === 'cookie') {
            return 'hooked-' + opts.rtnValue;
          }

          return opts.rtnValue;
        }

emilisb avatar Dec 15 '22 11:12 emilisb

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
partytown ✅ Ready (Inspect) Visit Preview Dec 15, 2022 at 11:59AM (UTC)

vercel[bot] avatar Dec 15 '22 11:12 vercel[bot]

Would the get hook instead be able to work in this scenario?

adamdbradley avatar Dec 19 '22 14:12 adamdbradley

@emilisb thanks for your commitment, this PR is stale. Is it abandoned?

gioboa avatar Jan 07 '24 20:01 gioboa

This PR is old, so I'm closing this for now. Feel free to re-open it if it's still valid. Thanks.

gioboa avatar Feb 24 '24 14:02 gioboa