Configures defaults for link handling.
In particular you can configure Unpoly to handle all links on the page
without requiring developers to set [up-...]
attributes.
An array of CSS selectors matching links that will be followed through Unpoly.
You can customize this property to automatically follow all links on a page without requiring an [up-follow]
attribute.
See Handling all links and forms.
Exceptions to config.followSelectors
.
Matching links will not be followed through Unpoly, even if they match config.followSelectors
.
By default Unpoly excludes:
[up-follow=false]
attribute.[href]
.[target]
attribute
(to target an iframe or open new browser tab).[download]
attribute.[href]
attribute starting with javascript:
.[href="#"]
attribute that don't also have local HTML
in an [up-document]
, [up-fragment]
or [up-content]
attribute.An array of CSS selectors matching links that are followed on mousedown
instead of on click
.
You can customize this property to follow all links on mousedown
without requiring an [up-instant]
attribute.
See Handling all links and forms.
Note that an instant link must also by followable, usually by giving it an
[up-follow]
attribute or by configuring up.link.config.followSelectors
.
Exceptions to config.followSelectors
.
Matching links will not be followed through Unpoly, even if they match config.followSelectors
.
By default Unpoly excludes:
[up-instant=false]
attribute.An array of CSS selectors matching links that are preloaded on hover.
You can customize this property to preload all links on mousedown
without requiring an [up-preload]
attribute.
See Handling all links and forms.
Exceptions to config.preloadSelectors
.
Matching links will not be preloaded on hover, even if they match config.preloadSelectors
.
By default Unpoly excludes:
[up-preload=false]
attribute.The number of milliseconds to wait before [up-preload]
starts preloading.
Whether Unpoly will load preload requests.
With the default setting ("auto"
) Unpoly will load preload requests
unless up.network.shouldReduceRequests()
detects a poor connection.
If set to true
, Unpoly will always preload links.
If set to false
, Unpoly will never preload links.
You may also configure a function that accepts a link element and returns true
, false
or 'auto'
.
Regardless of what you configure here, Unpoly will only preload links with safe methods.
A list of CSS selectors matching elements that should behave like links or buttons.
To make the link-like element as accessible as possible, it gains the following behaviors:
[role=link]
attribute so screen readers announce it as link.pointer
cursor when hovered over.up:click
event when activated.[up-instant]
attribute to make the element
activate on mousedown
instead of click
.
See [up-clickable]
, [up-href]
.