diff --git a/app/scripts/lib/util.js b/app/scripts/lib/util.js index a8930a2f3796..114203d7f8c8 100644 --- a/app/scripts/lib/util.js +++ b/app/scripts/lib/util.js @@ -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 diff --git a/test/unit/app/util-test.js b/test/unit/app/util-test.js index 259bd708bde1..a6a4a458c98a 100644 --- a/test/unit/app/util-test.js +++ b/test/unit/app/util-test.js @@ -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)