From 4e39165b79747de782d071f2be30cfc64319153a Mon Sep 17 00:00:00 2001 From: Justin Ribeiro Date: Thu, 1 Nov 2018 10:18:39 -0700 Subject: [PATCH] add chrome-extension to allowedProtocols, add test --- lighthouse-core/lib/url-shim.js | 2 +- lighthouse-core/test/lib/url-shim-test.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lighthouse-core/lib/url-shim.js b/lighthouse-core/lib/url-shim.js index 8327efff33c7..260136058d4c 100644 --- a/lighthouse-core/lib/url-shim.js +++ b/lighthouse-core/lib/url-shim.js @@ -25,7 +25,7 @@ const listOfTlds = [ ]; const allowedProtocols = [ - 'https:', 'http:', 'chrome:', + 'https:', 'http:', 'chrome:', 'chrome-extension:', ]; /** diff --git a/lighthouse-core/test/lib/url-shim-test.js b/lighthouse-core/test/lib/url-shim-test.js index 236127de7fd2..2247011ea296 100644 --- a/lighthouse-core/test/lib/url-shim-test.js +++ b/lighthouse-core/test/lib/url-shim-test.js @@ -40,6 +40,7 @@ describe('URL Shim', () => { assert.ok(URL.isProtocolAllowed('http://google.com/')); assert.ok(URL.isProtocolAllowed('https://google.com/')); assert.ok(URL.isProtocolAllowed('chrome://version')); + assert.ok(URL.isProtocolAllowed('chrome-extension://blipmdconlkpinefehnmjammfjpmpbjk/popup.html')); }); it('safely identifies disallowed URL protocols', () => {