Skip to content

Commit

Permalink
Merge branch 'master' of github.com:yireo/Yireo_LinkPreload
Browse files Browse the repository at this point in the history
  • Loading branch information
jissereitsma committed Apr 5, 2022
2 parents 191eb98 + a05f4bb commit 317bc89
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.4.15] - 5 April 2022
## [1.4.16] - 5 April 2022
### Fixed
- Prevent LinkPreload module on non-HTML content

## [1.4.15] - 31 March 2022
### Fixed
- Don't preload lazy loading images #36 (@Quazz)

## [1.4.14] - 20 February 2022
### Fixed
- Missing crossorigin in html output (@mageho)
Expand Down
5 changes: 4 additions & 1 deletion Link/LinkParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ private function addScriptsAsLinkHeader(Crawler $crawler)
private function addImagesAsLinkHeader(Crawler $crawler)
{
$crawler->each(function (Crawler $crawler) {
$this->addLink($crawler->extract(['src'])[0], 'image', $crawler->outerHtml());
$loadType = $crawler->extract(['loading']);
if (empty($loadType) || $loadType[0] !== "lazy") {
$this->addLink($crawler->extract(['src'])[0], 'image', $crawler->outerHtml());
}
});
}

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yireo/magento2-linkpreload",
"version": "1.4.15",
"version": "1.4.16",
"license": "OSL-3.0",
"type": "magento2-module",
"homepage": "https://www.yireo.com/software/magento-extensions/linkpreload",
Expand Down

0 comments on commit 317bc89

Please sign in to comment.