This commit is contained in:
_Bastler 2021-10-06 07:39:15 +02:00
parent 798aefc0ea
commit 049c0ed77b

View File

@ -45,15 +45,7 @@ export class PageSubmission implements OnInit {
} }
onTitleFocus(event): void { onTitleFocus(event): void {
fetch(this.form.get("url").value)
.then((response) => response.text())
.then((html) => {
const doc = new DOMParser().parseFromString(html, "text/html");
const title = doc.querySelectorAll('title')[ 0 ];
return title.innerText;
}).then((title) => {
this.form.get("title").setValue(title);
})
} }
create(): void { create(): void {