From 46c061d14271d03b6d323022ef94120b6f53b1ca Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Fri, 26 Apr 2024 11:04:32 -0400 Subject: [PATCH] Fix _getSnapshotLocation() logic --- src/dom/snapshot/snapshot-view.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dom/snapshot/snapshot-view.ts b/src/dom/snapshot/snapshot-view.ts index f4130170..42507c5c 100644 --- a/src/dom/snapshot/snapshot-view.ts +++ b/src/dom/snapshot/snapshot-view.ts @@ -127,9 +127,9 @@ class SnapshotView extends DOMView { let singleFileComment = this._iframeDocument.documentElement.firstChild; if (singleFileComment?.nodeType === Node.COMMENT_NODE && singleFileComment.nodeValue!.trim().startsWith('Page saved with SingleFile')) { - let matches = singleFileComment.nodeValue!.match(/^\s*url: (https?:\/\/.+)$/m); + let matches = singleFileComment.nodeValue!.match(/^\s*url: (https?:\/\/\S+)/m); if (matches) { - return matches[0].trim(); + return matches[1]; } } return null;