Skip to content

Commit

Permalink
Fixed lacking backslash in RegExp
Browse files Browse the repository at this point in the history
Fixes the issue with domains containing the keywords but not belonging to Google (like nomoregoogle.com) being opened in containers
  • Loading branch information
wodnikk authored Aug 17, 2020
1 parent 09ab953 commit 6cbd1bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ function generateGoogleHostREs () {

for (let googleDomain of GOOGLE_DOMAINS) {
googleDomain = googleDomain.replace(matchOperatorsRegex, '\\$&');
googleHostREs.push(new RegExp(`(^|\.)${googleDomain}$`));
googleHostREs.push(new RegExp(`(^|\\.)${googleDomain}$`));
}
for (let youtubeDomain of YOUTUBE_DOMAINS) {
youtubeDomain = youtubeDomain.replace(matchOperatorsRegex, '\\$&');
youtubeHostREs.push(new RegExp(`(^|\.)${youtubeDomain}$`));
youtubeHostREs.push(new RegExp(`(^|\\.)${youtubeDomain}$`));
}
}

Expand Down

0 comments on commit 6cbd1bf

Please sign in to comment.