Skip to content

Commit

Permalink
golf: only use document.head for append;
Browse files Browse the repository at this point in the history
- document.head is always defined
- 689 gz / 561 br
  • Loading branch information
lukeed committed Dec 14, 2018
1 parent 5f95309 commit 189984a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/prefetch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function linkPrefetchStrategy(url) {
link.onload = resolve;
link.onerror = reject;

(document.head || document.querySelector(`script`).parentNode).appendChild(link);
document.head.appendChild(link);
});
};

Expand Down

0 comments on commit 189984a

Please sign in to comment.