Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #8104 from brave/fix/8087
Browse files Browse the repository at this point in the history
do not show phishing warning for javascript URLs
  • Loading branch information
darkdh authored Apr 6, 2017
2 parents 4337315 + 58985e6 commit 93f51be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion js/lib/urlutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ const UrlUtil = {
isPotentialPhishingUrl: function (url) {
if (typeof url !== 'string') { return false }
const protocol = urlParse(url.trim().toLowerCase()).protocol
return ['data:', 'blob:', 'javascript:'].includes(protocol)
return ['data:', 'blob:'].includes(protocol)
},

/**
Expand Down
5 changes: 1 addition & 4 deletions test/unit/lib/urlutilTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,8 @@ describe('urlutil', function () {
it('returns true if input is a data URL', function () {
assert.equal(UrlUtil.isPotentialPhishingUrl('data:text/html,<script>alert("no crash")</script>'), true)
})
it('returns true if input is a js URL', function () {
assert.equal(UrlUtil.isPotentialPhishingUrl(' JAVASCRIPT:alert(1)'), true)
})
it('returns true if input is a blob URL', function () {
assert.equal(UrlUtil.isPotentialPhishingUrl(' blob:foo '), true)
assert.equal(UrlUtil.isPotentialPhishingUrl(' BLOB:foo '), true)
})
})
})

0 comments on commit 93f51be

Please sign in to comment.