Thanks for the reply Jagadeesh!
That's not ideal since it still requires a 'DONT_KNOW_YET' state. We've done some more searching and found this StackOverflow post that looks like it might work:
https://stackoverflow.com/questions/65300347/how-to-know-that-web-app-is-access-on-browser-or-from-teams-custom-app . the crux of it being to check
window.name === "embedded-page-container" ||
window.name === "extension-tab-frame"
So I'll give that a go. It looks a little flakey though since it relies on teams setting the window.name.
Thanks!