client link crossorigin

This commit is contained in:
yuri
2019-05-20 15:22:26 +03:00
parent 224b73eb89
commit 362f895e72
2 changed files with 9 additions and 3 deletions
@@ -132,7 +132,11 @@ class ClientManager
$as = $item['as'] ?? '';
$rel = $item['rel'] ?? '';
$type = $item['type'] ?? '';
$linksHtml .= "\n <link rel=\"{$rel}\" href=\"{$href}\" as=\"{$as}\" as=\"{$type}\">";
$additinalPlaceholder = '';
if (empty($item['crossorigin'])) {
$additinalPlaceholder .= ' crossorigin';
}
$linksHtml .= "\n <link rel=\"{$rel}\" href=\"{$href}\" as=\"{$as}\" as=\"{$type}\"{$additinalPlaceholder}>";
}
$data = [
@@ -31,14 +31,16 @@
"as": "font",
"type": "font/ttf",
"rel": "preload",
"noTimestamp": true
"noTimestamp": true,
"crossorigin": true
},
{
"href": "client/fonts/open-sans/OpenSans-Regular.ttf",
"as": "font",
"type": "font/ttf",
"rel": "preload",
"noTimestamp": true
"noTimestamp": true,
"crossorigin": true
}
]
}