How can I access the current content representation?

In Kirby 2, you could access the current representation through $site->representation. I cannot find a way to do the same in version 3. Is it still possible somehow or is there an alternate way?

I’m using it for some logic in a controller that change the result based on this information.

What exactly did that property return?

It was null by default and returned the representation (like “json”) otherwise. I think it simply is the url extension and I can probably extract it with some url helper.

I was able to replicate Kirby 2’s representation value by using F::extension(Url::stripQuery(kirby()->request()->url()->toString())).