Skip to content

Commit

Permalink
Fix phishing detect script (#7287)
Browse files Browse the repository at this point in the history
  • Loading branch information
whymarrh authored Oct 18, 2019
1 parent a646bfb commit 06536b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/scripts/lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const getEnvironmentType = (url = window.location.href) => {
const parsedUrl = new URL(url)
if (parsedUrl.pathname === '/popup.html') {
return ENVIRONMENT_TYPE_POPUP
} else if (parsedUrl.pathname === '/home.html') {
} else if (['/home.html', '/phishing.html'].includes(parsedUrl.pathname)) {
return ENVIRONMENT_TYPE_FULLSCREEN
} else if (parsedUrl.pathname === '/notification.html') {
return ENVIRONMENT_TYPE_NOTIFICATION
Expand Down
7 changes: 6 additions & 1 deletion test/unit/app/util-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,16 @@ describe('getEnvironmentType', function () {
assert.equal(environmentType, ENVIRONMENT_TYPE_NOTIFICATION)
})

it('should return fullscreen type', function () {
it('should return fullscreen type for home.html', function () {
const environmentType = getEnvironmentType('http://extension-id/home.html')
assert.equal(environmentType, ENVIRONMENT_TYPE_FULLSCREEN)
})

it('should return fullscreen type for phishing.html', function () {
const environmentType = getEnvironmentType('http://extension-id/phishing.html')
assert.equal(environmentType, ENVIRONMENT_TYPE_FULLSCREEN)
})

it('should return background type', function () {
const environmentType = getEnvironmentType('http://extension-id/_generated_background_page.html')
assert.equal(environmentType, ENVIRONMENT_TYPE_BACKGROUND)
Expand Down

0 comments on commit 06536b1

Please sign in to comment.