In Drupal 8, how do I get all CSS and JS that is attached to a page? In Drupal 7, I could use drupal_add_css()
or drupal_add_js()
without arguments, to get an array containing a list of all the files/inline added to a page.
I’m developing a module that will display a “preview” of the block on block configuration page. The method I chose is displaying the block code in a <iframe>
, but to be properly styled, I need to output all styles with it. This is why I want to read all possible CSS/JS in this “preview” page controller.