I think on Drupal 7 I had previously used something like menu_get_object()
to find out what content I was on. For example, with mysite.com/content/my-page, it would tell me that this was a node, its content type, its ID, etc.
Ideally I'm trying to do it even if the URL is the site's front page, I'd like to be able to reverse engineer what content it is showing me.