-
Notifications
You must be signed in to change notification settings - Fork 975
Conversation
@@ -108,7 +108,7 @@ class UrlBar extends ImmutableComponent { | |||
const isLocationUrl = isUrl(location) | |||
// If control key is pressed and input has no space in it add www. as a prefix and .com as a suffix. | |||
// For whitepsace we want a search no matter what. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably update this comment about whitespace and searching too.
Thanks for the PR! Can you add some unit tests for this in |
@bridiver You are completely right. I have fixed this behaviour and added tests as you requested. Do you want me to refactor appUrlUtil all across the codebase or it is in the scope of another ticket? |
// for cases, data:uri and view-source:uri | ||
const case4Reg = /^\w+:.*/ | ||
// for cases, data:uri, view-source:uri and about | ||
const case4Reg = /^data|view-source|about\:.*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think those might just be examples and not an exhaustive list. We also have registered and app protocols like bitcoin, 1password, etc... @bbondy ?
Thanks! Can you add just a few more tests to cover all the changes? The other cases I can think of are
|
can you do an |
@bridiver I think linting is failing generally even on master, it is not a fault on my branch. Can you please tell me what are the registered protocols for lastpass, bitcoint ect, so I can add them to the test as well? I believe they should invoke |
at least some of the lint errors appear to be related to these changes https://travis-ci.org/brave/browser-laptop/builds/152446285 |
lint normally runs as a precommit hook on other platforms, but doesn't run on windows. I'm switching it to a pre-push hook that should work everywhere |
Add some more tests
@bridiver Fixed linting. Added few more test cases. Let me know if you find anything else that seems not ok. |
Looks good! Just waiting for CI to finish and I'll merge if everything looks good there. I know some tests are broken in master right now so I'm only looking for yours to pass. |
@bridiver Cool, thanks man! |
++ |
git rebase -i
to squash commits if needed.cc @bbondy @bridiver @bsclifton
This PR allows to open valid URLs whith whitespace in it such as
https://s10.postimg.org/snp1s3aah/Screenshot+from 2016-08-13 17-50-27.png
The original behaviour to query the search engine is preserved if you type a word or set of words. But if the string starts with scheme, no matter it has whitespace in it it will try to load the url.
What is the behaviour now?
http://example.com/test image.jpg
http://example.com/test image.jpg
via default search enginehttp://example.com/test image.jpg