How to get the list of blocks for the current page?
To get all blocks in an array by region, you can do as follow

// Get the current theme used
$theme = \Drupal::theme()-&gt;getActiveTheme()-&gt;getName();

// And pass the theme name to get all the regions
$regions = system_region_list($theme, $show = REGIONS_ALL);

// This will give you all the regions in array format
$regions =  json_decode(json_encode(system_region_list(\Drupal::config('system.theme')-&gt;get('default'),$show = REGIONS_ALL)),true);

// Loop over each regions
foreach ($regions as $key =&gt; $region) {
  // Get the blocks in particular region
  $blocks[$key] = \Drupal::entityManager()
    -&gt;getStorage('block')
    -&gt;loadByProperties([
      'theme' =&gt;  \Drupal::config('system.theme')-&gt;get('default'),
      'region'=&gt; $key,
    ]);
}