Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

Commit 5b5bde8

Browse files
committed
Fix getBaseIconsUrl
1 parent 16b3317 commit 5b5bde8

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

js/content.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,19 @@
192192
getBaseIconsUrl() {
193193
let svgUse = document.querySelector('svg.s16 > use');
194194

195-
if (!svgUse) {
195+
if (!svgUse || !svgUse.href.baseVal) {
196196
return null;
197197
}
198198

199-
let href = new URL(svgUse.href.baseVal);
199+
let url = svgUse.href.baseVal;
200200

201-
return this.baseUrl + '/' + href.pathname;
201+
if (url.startsWith('/')) {
202+
url = this.baseUrl + url;
203+
}
204+
205+
let parsedUrl = new URL(url);
206+
207+
return parsedUrl.protocol + '//' + parsedUrl.host + '/' + parsedUrl.pathname;
202208
}
203209

204210
/**

0 commit comments

Comments
 (0)