Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async componentDidMount() {
try {
const { url, html } = await getPageInfo()
const icons = await parseFavicon(html, {
baseURI: url
, allowUseNetwork: true
, allowParseImage: true
}, true)
for (const i in icons) {
if (!icons[i].size) {
try {
icons[i].size = await getRemoteImageSize(icons[i].url)
} catch(e) {
void(0)
}
}
}
this.setState({
loading: false
, data: icons