billy-herrington-utils 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/billy-herrington-utils.es.js +2 -4
- package/dist/billy-herrington-utils.es.js.map +1 -1
- package/dist/billy-herrington-utils.umd.js +2 -4
- package/dist/billy-herrington-utils.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/userscripts/pagination-parsing/pagination-strategies/PaginationStrategyPathnameParams.ts +0 -1
- package/src/userscripts/pagination-parsing/pagination-utils/index.ts +1 -2
|
@@ -496,16 +496,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
496
496
|
function getPaginationLinks(doc = document, url = location.href, pathnameSelector = /\/(page\/)?\d+\/?$/) {
|
|
497
497
|
const currentUrl = parseURL(url);
|
|
498
498
|
currentUrl.pathname = currentUrl.pathname.replace(pathnameSelector, "/");
|
|
499
|
+
const pathnameStrict = doc instanceof Document;
|
|
499
500
|
const pageLinks = Array.from(
|
|
500
501
|
doc.querySelectorAll("a[href]") || [],
|
|
501
502
|
(a) => a.href
|
|
502
503
|
).filter((h) => {
|
|
503
504
|
try {
|
|
504
505
|
const linkUrl = new URL(h.replace(/#\w*$/, ""), doc.baseURI || currentUrl.origin);
|
|
505
|
-
return (
|
|
506
|
-
// in case of origin sometimes it's protocols problem cause some links can be not https but http
|
|
507
|
-
linkUrl.hostname === currentUrl.hostname && linkUrl.pathname.startsWith(currentUrl.pathname)
|
|
508
|
-
);
|
|
506
|
+
return linkUrl.hostname === currentUrl.hostname && (pathnameStrict ? linkUrl.pathname.startsWith(currentUrl.pathname) : true);
|
|
509
507
|
} catch {
|
|
510
508
|
return false;
|
|
511
509
|
}
|