Skip to content

Commit

Permalink
core(lib): add chrome-extension to URL allowedProtocols and add test (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
justinribeiro authored and paulirish committed Nov 1, 2018
1 parent 76ec168 commit 5b0105f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lighthouse-core/lib/url-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const listOfTlds = [
];

const allowedProtocols = [
'https:', 'http:', 'chrome:',
'https:', 'http:', 'chrome:', 'chrome-extension:',
];

/**
Expand Down
1 change: 1 addition & 0 deletions lighthouse-core/test/lib/url-shim-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit 5b0105f

Please sign in to comment.