Edit this page

up.link up.link.config
JavaScript property

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.

Value

config.followSelectors Array<string>

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.

config.noFollowSelectors Array<string>

Exceptions to config.followSelectors. Matching links will not be followed through Unpoly, even if they match config.followSelectors.

By default Unpoly excludes:

  • Links with an [up-follow=false] attribute.
  • Links with a cross-origin [href].
  • Links with a [target] attribute (to target an iframe or open new browser tab).
  • Links with a [rel=download] attribute.
  • Links with an [href] attribute starting with javascript:.
  • Links with an [href="#"] attribute that don't also have local HTML in an [up-document], [up-fragment] or [up-content] attribute.
config.instantSelectors Array<string>

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.

config.noInstantSelectors Array<string>

Exceptions to config.followSelectors. Matching links will not be followed through Unpoly, even if they match config.followSelectors.

By default Unpoly excludes:

  • Links with an [up-instant=false] attribute.
  • Links that are not followable.
config.preloadSelectors Array<string>

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.

config.noPreloadSelectors Array<string>

Exceptions to config.preloadSelectors. Matching links will not be preloaded on hover, even if they match config.preloadSelectors.

By default Unpoly excludes:

[config.preloadDelay=75] number optional

The number of milliseconds to wait before [up-preload] starts preloading.

[config.preloadEnabled='auto'] booleanorstring optional

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 load preload links.

If set to false, Unpoly will never preload links.

[config.clickableSelectors] Array<string> optional

A list of CSS selectors matching elements that should behave like links or buttons.

See [up-clickable].

This website uses cookies to improve usability and analyze traffic.
I accept or learn more