In EPiServer 4.6x there was a method that would allow you to determine whether or not the user was viewing the page in Edit Mode or Admin Mode, which came in really useful for disabling third party analytics tools and so on if the user was viewing through Edit Mode.
I can't seem to find a similar method or way of determining this information in EPiServer 5 SP2, could somebody please let me know if they've achieved this?
The URL you're currently browsing will never contain a mention of the UIUrl path, because that's only used for the pages that call the page being viewed.
You can compare against Request.UrlReferrer instead though, which does pretty much what I want to, apart from the scenario where you've just left edit mode by clicking the "View Mode" button, in this scenario you've got a referrer from the edit mode but you're not actually in edit mode anymore.
It'll do for now, though at some point perhaps EPiServer should consider reinstating the methods that were available in previous versions.