|
|
@@ -300,6 +300,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
title = titleElement.textContent.trim();
|
|
|
}
|
|
|
const matchTitle = this.baseURI.match(/([^/]*)\/?(\.html?.*)$/) || this.baseURI.match(/\/\/([^/]*)\/?$/);
|
|
|
+ const url = new URL(this.baseURI);
|
|
|
let size;
|
|
|
if (this.options.displayStats) {
|
|
|
size = new Blob([this.doc.documentElement.outerHTML]).size;
|
|
|
@@ -311,7 +312,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
}
|
|
|
return {
|
|
|
stats: this.stats,
|
|
|
- title: title || (this.baseURI && matchTitle ? matchTitle[1] : ""),
|
|
|
+ title: title || (this.baseURI && matchTitle ? matchTitle[1] : (url.hostname ? url.hostname : "Untitled page")),
|
|
|
content
|
|
|
};
|
|
|
}
|