Skip to content

Commit

Permalink
new URL(...): add location.href as second parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
addyosmani committed Dec 14, 2018
1 parent 3027c72 commit d8ed5f9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const observer = new IntersectionObserver(entries => {
*/
function prefetcher(url) {
toPrefetch.delete(url);
prefetch(new URL(url).toString(), observer.priority);
prefetch(new URL(url, location.href).toString(), observer.priority);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion test/test-static-url-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<script src="../dist/quicklink.umd.js"></script>
<script>
quicklink({
urls: ['http://127.0.0.1:8080/test/2.html','http://127.0.0.1:8080/test/4.html']
urls: ['2.html','4.html']
});
</script>
</body>
Expand Down

0 comments on commit d8ed5f9

Please sign in to comment.