Skip to content

Commit b5db4c1

Browse files
committed
fix: for custom targets
1 parent 52da903 commit b5db4c1

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,4 +206,11 @@
206206

207207
### Fixed
208208

209-
- Fixed target being customizable
209+
- Fixed target being customizable
210+
211+
## v3.8.16
212+
213+
### Fixed
214+
215+
- Fixed target being customizable
216+
- Fixed Toploader not crawling by reverting the pr #109 that is "fix bug: target is customizable"

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Shri Ganesh Jha
3+
Copyright (c) 2025 Shri Ganesh Jha
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@thesgj/nextjs-toploader",
3-
"version": "3.6.15",
3+
"version": "3.8.16",
44
"exports": "./src/index.tsx",
55
"compilerOptions": {
66
"jsx": "react-jsx",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nextjs-toploader",
3-
"version": "3.8.15",
3+
"version": "3.8.16",
44
"description": "A Next.js Top Loading Bar component made using nprogress, works with Next.js 15 and Next.js 14 and React.",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,10 @@ const NextTopLoader = ({
242242
if (newUrl) {
243243
const currentUrl = window.location.href;
244244
// const newUrl = (anchor as HTMLAnchorElement).href;
245-
const isExternalLink = (anchor as HTMLAnchorElement).target === '_blank';
245+
246+
// To debug the anchor target:
247+
// console.log('Given target is', (anchor as HTMLAnchorElement).target);
248+
const isExternalLink = ((anchor as HTMLAnchorElement).target as React.HTMLAttributeAnchorTarget) !== '' ;
246249

247250
// Check for Special Schemes
248251
const isSpecialScheme = ['tel:', 'mailto:', 'sms:', 'blob:', 'download:'].some((scheme) =>

0 commit comments

Comments
 (0)