Skip to content

Commit

Permalink
Merge pull request #19 from davevanhoorn/master
Browse files Browse the repository at this point in the history
feat: do not trigger NProgress when new URL starts with "blob:"
  • Loading branch information
TheSGJ authored Oct 16, 2023
2 parents e75c04a + 90592ed commit 5854c1f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,10 @@ const NextTopLoader = ({
const currentUrl = window.location.href;
const newUrl = (anchor as HTMLAnchorElement).href;
const isExternalLink = (anchor as HTMLAnchorElement).target === "_blank";
const isBlob = newUrl.startsWith('blob:');
const isAnchor = isAnchorOfCurrentUrl(currentUrl, newUrl);
if (newUrl === currentUrl || isAnchor || isExternalLink) {

if (newUrl === currentUrl || isAnchor || isExternalLink || isBlob) {
NProgress.start();
NProgress.done();
[].forEach.call(npgclass, function (el: Element) {
Expand Down

0 comments on commit 5854c1f

Please sign in to comment.