Skip to content

Commit

Permalink
docs(README): add URL fragments note about ignores (#52, #49)
Browse files Browse the repository at this point in the history
  • Loading branch information
addyosmani committed Dec 17, 2018
1 parent 02778df commit c28c002
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,19 @@ quicklink({
});
```

You may also wish to ignore prefetches to URLs which contain a URL fragment (e.g. `index.html#top`). This can be useful if you (1) are using anchors to headings in a page or (2) have URL fragments setup for a single-page application, and which to avoid firing prefetches for similar URLs.

Using `ignores` this can be achieved as follows:

```js
quicklink({
ignores: [
uri => uri.includes('#')
// or /#(.+)/ if you prefer RegExp
]
});
```

## Browser support

The prefetching provided by `quicklink` can be viewed as a [progressive enhancement](https://www.smashingmagazine.com/2009/04/progressive-enhancement-what-it-is-and-how-to-use-it/). Cross-browser support is as follows:
Expand Down

0 comments on commit c28c002

Please sign in to comment.