Use the following to see the route of the current page.
/**
* Implements hook_preprocess_page().
*
*/
function mycustomtheme_preprocess_page(&$variables) {
\Drupal::messenger()->addStatus(\Drupal::routeMatch()->getRouteName());
}
Add this to your theme file or a module file and clear the caches.
If you visit a page on this theme you will see a message being shown on the site. For example, the user profile page will show this.
entity.user.canonical
Add new comment