metascraper-logo-favicon 5.56.2 → 5.58.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +7 -7
  2. package/src/index.js +8 -2
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "metascraper-logo-favicon",
3
3
  "description": "Metascraper logo fallback that picks favicons and apple-touch icons from HTML.",
4
4
  "homepage": "https://github.com/microlinkhq/metascraper/packages/metascraper-logo-favicon",
5
- "version": "5.56.2",
5
+ "version": "5.58.4",
6
6
  "types": "src/index.d.ts",
7
7
  "main": "src/index.js",
8
8
  "author": {
@@ -31,15 +31,15 @@
31
31
  "scraper"
32
32
  ],
33
33
  "dependencies": {
34
- "@keyvhq/memoize": "~2.2.4",
35
- "@metascraper/helpers": "5.56.2",
34
+ "@keyvhq/memoize": "~2.2.7",
35
+ "@metascraper/helpers": "5.58.4",
36
36
  "lodash": "~4.18.1",
37
- "reachable-url": "~2.1.0"
37
+ "reachable-url": "~2.1.4"
38
38
  },
39
39
  "devDependencies": {
40
+ "@kikobeats/got": "11",
40
41
  "async-listen": "latest",
41
- "ava": "8",
42
- "got": "11"
42
+ "ava": "8"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">= 22"
@@ -57,5 +57,5 @@
57
57
  "!test/helpers.js"
58
58
  ]
59
59
  },
60
- "gitHead": "63168a1c6ab9fa67552a13fd9e4a60ad4c10f953"
60
+ "gitHead": "999e1edf52104ca823da226800cb952e0d428f2b"
61
61
  }
package/src/index.js CHANGED
@@ -66,7 +66,9 @@ const getSize = (url, sizes) =>
66
66
  const getDomNodeSizes = (domNodes, attr, url) =>
67
67
  domNodes.reduce((acc, domNode) => {
68
68
  const relativeUrl = domNode.attribs[attr]
69
- if (!relativeUrl || relativeUrl === url) return acc
69
+ if (!relativeUrl || relativeUrl === url || relativeUrl.startsWith('#')) {
70
+ return acc
71
+ }
70
72
 
71
73
  const normalizedUrl = normalizeUrl(url, relativeUrl)
72
74
  if (!normalizedUrl) return acc
@@ -92,7 +94,11 @@ const getSizes = ($, collection, url) =>
92
94
 
93
95
  const sizeSelectors = [
94
96
  { tag: 'link[rel*="icon" i]', attr: 'href' }, // apple-icon, // fluid-icon
95
- { tag: 'meta[name*="msapplication" i]', attr: 'content' } // Windows 8, Internet Explorer 11 Tiles
97
+ // TileImage / *logo — not TileColor, navbutton-color, or browserconfig.
98
+ {
99
+ tag: 'meta[name="msapplication-TileImage" i], meta[name*="msapplication-" i][name*="logo" i]',
100
+ attr: 'content'
101
+ }
96
102
  ]
97
103
 
98
104
  const firstReachable = async (domNodeSizes, resolveFaviconUrl, gotOpts) => {