5digits / dactyl

Pentadactyl and other related Gecko extensions
Other
470 stars 98 forks source link

Implement logical links (i.e. <link rel="start">) #94

Open Wuzzy2 opened 8 years ago

Wuzzy2 commented 8 years ago

HTML has a cool feature since HTML 2.0 (or so) which is pretty much ignored for no apparent reason by all browsers I know, including Firefox.

This feature is defined here:

http://www.w3.org/TR/html4/types.html#type-links

One example: If you put this into your <head>:

<link rel="start" href="/index.html">

Then it adds a reference to the home page, or starting page (of the web site, not of the browser, that is). Browsers are supposed to somehow make this link accessible.

Since Firefox doesn't do it, maybe at least Pentadactyl can do it?

The general command to access logical links could be “:link”. :link alone shows a list of available logical links on the current page.

:link <rel> changes the current buffer to the selected link. I.e. :link start moves you to the start page, if it is defined (otherwise it gives an error).

Some special treatment might be given regarding alternate and stylesheet, I am unsure what to do with these.

Also the meaning of the following commands should change:

[[ (previous page) ]] (next page)

Currently, those are basically using a really ugly hack by simply searching the HTML source for links which contain a text like “previous” or “next”. They could instead use link rel="previous" and link rel="next", repectively.

Also gh should simply point to link rel="start" instead of trying to guess the home page.

And no, implementing this is an Pentadactyl plugin is not an option because:

a) This would conflict with current usage of [[, ]] and gh (at least on a semantic level) b) IMO core HTML features should be implemented by the core application

As a compromise, the current guessing algorithm could be put into different (legacy?) commands.