Find if $view object is a block or page I am unable to debug this because when I print the display object I get a memory error from the size.
so with something like this I can get the display title.

function mailnow_views_pre_render(\Drupal\views\ViewExecutable $view) {
  $displayObj = $view-&gt;getDisplay();
  $displayName = $displayObj-&gt;display['display_title'];
}


I can get the machine name with $view-&gt;current_display == 'companies_page'

But I want to be able to get the display type for instance "Block" or "Page"
You can get it with

$plugin_id = $view-&gt;style_plugin-&gt;displayHandler-&gt;getPluginId();