-
-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolves: non-option argument instead of --startup-url #227
Conversation
One issue I ran into was that tabs did not open up in order of command. They get out of sync from the browsh terminal and firefox |
@farhadmak I think that's pre-existing. If you run FF and close one of the tabs, for example, the TTY side will be out of sync. |
Looks like a binary file snuck in. Can you remove interfacer/src/debug? |
Looks good. Thanks @farhadmak! |
I'm going to test this later. Is it necessary to check for URL validity? What about special pages such as about:config, which admittedly Browsh doesn't support currently anyhow, or simple file paths such as /home/user/index.html, which currently also doesn't work, but is a requested feature. Or what about going to a bookmark/often visited site by searching for a part of the URL. I.e. I might want to start with: Thinking about it the URL validation will still make sense once we implement the features mentioned above, we'd need a way to distinguish valid URLs and other types of page requests. I'm likely to merge this later. Thanks @farhadmak for implementing and @j-rewerts for commenting. The issue of the tab order being wrong could perhaps be solved by adding a new command new_tabs instead of new_tab in the webextension or by letting the new_tab command accept multiple arguments. |
This PR will only work with links as the URL validity will search for “http://“ or related and web extension would open each link. This being said, I believe it would be very easy to implement once the special pages start to work. Would you like me to take a look at adding a letting new_tab accept multiple commands in this pr, or make it a separate issue |
@farhadmak browsh "bash documentation" "top10 books of 2018" But this doesn't have to be implemented right now, I'd accept your pull request with the current features. It'd be nice if you kept adding more features to Browsh later, though. :-) If letting new_tab accept multiple arguments fixes the resulting tab order, this would be great. It's not required for me to accept your patch though. |
@farhadmak I believe the URL/URI validation is too aggressive. It accepts http://www.google.com, yet not www.google.com and in my opinion it should also accept google.com. I think you should simply extract the top level domain part and test if it's reachable (read: if a ping gets returned). Let's say I start browsh with lwn.net/some/path/to/an/article, then your code should extract lwn.net as the top-level domain and ping it. If that succeeds, you've a URI/URL that can be opened and it should be. You could keep the current validation as first level of testing, because it might be quicker in a lot of circumstances, and the pinging should be the second level of testing for strings that were not recognized as URLs in the first level of testing. We're sometimes using the term URI and at other times URL. Maybe you should change validURL to validURI, since it's a derivative of the ParseRequestURI call's results. I hope you're willing to refine this further. I'd be thrilled to see more pull requests from you. I'm merging this, welcome to the Browsh development community. |
Sounds good, I'll push an update this coming week. |
@tobimensch with So this means, with any non-flag arguments, it will open a new tab with the link, or google search if it is not a valid link. Is this what we want? |
Resolves #205