From 79184a6711e08e1149111116d34f8723fab7e783 Mon Sep 17 00:00:00 2001 From: ik9999 Date: Wed, 9 Jun 2021 23:14:14 +0400 Subject: [PATCH] v3.1.5 update google parser --- package.json | 2 +- src/manifest.json | 2 +- src/popup/search/googleHTML.js | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 7eee82a..075c5bb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "popupsearch", - "version": "3.1.4", + "version": "3.1.5", "description": "Chrome extension for searching", "author": "q@eqw.me", "scripts": { diff --git a/src/manifest.json b/src/manifest.json index b7a4378..e2797f3 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,7 +1,7 @@ { "name": "PopupSearch", "description": "Chrome extension for searching in googleâ„¢ using popup window with keyboard navigation support", - "version": "3.1.4", + "version": "3.1.5", "manifest_version": 2, "icons": { "48": "icons/icon_48.png", diff --git a/src/popup/search/googleHTML.js b/src/popup/search/googleHTML.js index e47fcae..d33fab4 100644 --- a/src/popup/search/googleHTML.js +++ b/src/popup/search/googleHTML.js @@ -172,8 +172,12 @@ export default async function(query, start) { return false; } if (childNodeDomEl.nodeName === 'A') { - let hostname = _.trimStart((new URL(childNodeDomEl.href)).host, 'www.'); - if (hostname !== itemHrefHost) { + let hostname = undefined; + try { + hostname = _.trimStart((new URL(childNodeDomEl.href)).host, 'www.'); + } catch (e) { + } + if (hostname && hostname !== itemHrefHost) { isValid = false; return false; }