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

Commit

Permalink
Trim URLbar input
Browse files Browse the repository at this point in the history
Fix #519

Auditors: @diracdeltas
  • Loading branch information
bbondy committed Feb 1, 2016
1 parent 559f9aa commit 22a6ea3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions js/actions/windowActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const WindowActions = {
* @param {string} location - The URL of the page to load
*/
loadUrl: function (activeFrame, location) {
location = location.trim()
let newFrame = false
if (activeFrame.get('isPinned')) {
try {
Expand Down Expand Up @@ -82,6 +83,7 @@ const WindowActions = {
* it is active the URL text will also be changed.
*/
setLocation: function (location, key) {
location = location.trim()
if (UrlUtil.isURL(location)) {
location = UrlUtil.getUrlFromInput(location)
}
Expand Down
1 change: 1 addition & 0 deletions js/lib/appUrlUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,6 @@ export function isPrivilegedUrl (input) {
* @param {string} input
*/
export function isUrl (input) {
input = input.trim()
return (UrlUtil.isURL(input) && !input.includes(' '))
}

1 comment on commit 22a6ea3

@diracdeltas
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Please sign in to comment.