I want to add attribute rel ='preload' and onload="this.rel='stylesheet'" as done in advagg ?I have done in hook_css_later function but no luck . Here is my code
function page_speed_css_alter(&$css) {
foreach ($css as $key=>&$item) {
if (file_exists($item['data'])) {
$item['preprocess'] = FALSE;
$item['attributes']['rel'] = "preload";
$item['attributes']['onload'] = "this.rel='stylesheet'";
}
}
}
You’ll have to patch core if you don’t want to use advagg. Any reason why you don’t want to use it?