Skip to content

Commit

Permalink
DRY logic fix from @lloan, better quailify bg function to get getCurr…
Browse files Browse the repository at this point in the history
…entPageHostname
  • Loading branch information
maxxcrawford committed Mar 14, 2023
1 parent 92899a1 commit 6184ed0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/js/background/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ async function getCurrentPage() {

async function getCurrentPageHostname() {
const currentPage = await getCurrentPage();

if (currentPage.url) {
if (currentPage && currentPage.url) {
const url = new URL(currentPage.url);
return url.hostname;
}
Expand Down
6 changes: 1 addition & 5 deletions src/js/popup/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -1152,11 +1152,7 @@
const domainList = mask.used_on;

// Short circuit out if there's no used_on entry
if (
domainList === null ||
domainList === "" ||
domainList === undefined
) {
if ([undefined, null, ""].includes(domainList)) {
return false;
}

Expand Down

0 comments on commit 6184ed0

Please sign in to comment.