diff --git a/webextensions/resources/group-tab.js b/webextensions/resources/group-tab.js index 07524afe1..6c853d5c7 100644 --- a/webextensions/resources/group-tab.js +++ b/webextensions/resources/group-tab.js @@ -34,10 +34,11 @@ function getTitle() { let title = params.get('title'); if (!title) { - title = location.search.match(/^\?([^&;]*)/); + const matched = location.search.match(/^\?([^&;]*)/); + if (matched) + title = decodeURIComponent(matched[1]); } - return title && decodeURIComponent(title[1]) || - browser.i18n.getMessage('groupTab_label_default'); + return title || browser.i18n.getMessage('groupTab_label_default'); } function setTitle(title) {