Skip to content
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

Relative goto actions #119

Open
rodarima opened this issue Apr 3, 2024 · 3 comments
Open

Relative goto actions #119

rodarima opened this issue Apr 3, 2024 · 3 comments
Labels
enhancement New feature or request UX User experience

Comments

@rodarima
Copy link
Member

rodarima commented Apr 3, 2024

From #88

I would rather want a "relative mode". For example, if the current URL is http://example.net/examples/42.html and you type / then it will go to http://example.net/ and if you type ~/ then it will go to http://example.net/examples/~/. It would do this with all URLs, not only those ones. If you include the scheme then it is an absolute URL. (I have managed to modify Firefox to work like this.)

This can be made by adding two extra actions that select a partial segment of the path, allowing the user to type a replacement:

  • goto-path would select only https://example.org/foo/bar.html
  • goto-filename would select only https://example.org/foo/bar.html
  • goto would select the whole thing, as we currently do with Ctrl+L

Then the user can type there whatever you need. Mapping those actions to / and ~ in ~/.dillo/keysrc would cause a similar effect as what you describe.

CC @zzo38

@rodarima rodarima added enhancement New feature or request UX User experience labels Apr 3, 2024
@zzo38
Copy link

zzo38 commented May 8, 2024

This is a rather more complicated and messy way of an actual relative mode. Rather, it should be a separate option (or possibly a binding which can be mapped to the enter key while the URL is focused), which treats any entered URL as relative to the current URL. (This is also what line mode browser does, and it is more useful than what most modern browsers do, in my opinion.)

@rodarima
Copy link
Member Author

rodarima commented May 8, 2024

This is a rather more complicated and messy way of an actual relative mode. Rather, it should be a separate option (or possibly a binding which can be mapped to the enter key while the URL is focused), which treats any entered URL as relative to the current URL. (This is also what line mode browser does, and it is more useful than what most modern browsers do, in my opinion.)

I think I understand what you mean, but it would be nice if you provide some more extra examples of how you would use it, as I'm not familiar with the relative addressing in the line mode browser. Specifically, where do you "type" the relative address, at the end of the URL? In another buffer? Or the URL is cleared?

I guess that when you are in the location bar you could enter a "relative addressing mode" and then you type in a special buffer (not necessarily editting the URL), and based on what you type the location is changed accordingly when you press enter.

Or you can just press a key binding to enter relative addressing by reusing the location bar, which is erased and then what you type there is a relative URL and will be applied when you press enter (assuming you don't need to see the previous address).

We could also assume that having the location URL selected via Ctrl+L allows relative addressing, so if at that point you type ~, the file part of the url is removed and you can begin typing your relative path. And the same for /. If you would like to instead type ~ or /, you simple erase the location bar first.

Apart from / and ~, are there any other special addressing symbols? Also, do you expect it to be able to paste a relative address? Does it have to be those symbols?, in non US keyboards, the tilde ~ requires Alt Gr, so I would rather prefer to have a configurable keybinding instead. As I will access the location bar with Ctrl+L, while I keep the Ctrl key pressed, I could use Ctrl+L and then Ctrl+R (for example) to select the URL and then erase the current file in the path, and begin typing the next one.

In any case, I believe that having a visual guidance would be more easy to understand for non-expert users.

As a side note, if you press Ctrl+Shift and then the arrow keys you can select the URL by parts, like in other browsers.

@zzo38
Copy link

zzo38 commented May 10, 2024

I'm not familiar with the relative addressing in the line mode browser. Specifically, where do you "type" the relative address, at the end of the URL?

Line mode browser uses command-line interface; the g command will go to a specified relative URL (or absolute if it includes a scheme).

Apart from / and ~, are there any other special addressing symbols?

Any text entered would be treated as a relative URL (unless it includes a scheme, in which case it is absolute), regardless of the symbols used.

(It is effectively the same as though you are following a link from the current document that has a <a href> with the user-entered URL, except that <base> is ignored and security features restricting cross-site linking are ignored; e.g. if you type G.html and you are currently at http://example.org/y.html then you will go to http://example.org/G.html.)

in non US keyboards, the tilde ~ requires Alt Gr, so I would rather prefer to have a configurable keybinding instead

I agree with this; the keybinding could be mapped to "go to relative URL"; if you use that keybinding and then type a URL that includes a scheme, then it has the same effect as "go to absolute URL". (Alternatively, it could be a separate setting which affects the behaviour of the location bar. Another alternative would be a key binding which is attached to the location bar (if it supports attaching key bindings to widgets in this way; I don't know if it does) so only works if the location bar is focused; the enter key would be mapped to "go to absolute URL" by default, but you can remap it to "go to relative URL" if you prefer.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request UX User experience
Projects
None yet
Development

No branches or pull requests

2 participants