mue
mue copied to clipboard
[Bug] Quick Links add/edit generated error
- The Name field is automatically filled with the URL if none is specified. Couldn't you read the title tag name here?
- The field icon (optional) will be automatically filled with the URL, this will prevent the icon from loading.

I've fixed 2. for you, but 1. is difficult without API changes due to CORS.
If you want to have a go at it yourself, this is what I got to:
async getTitle(url) {
let title;
try {
let response = await fetch(url);
if (response.redirected) {
response = await fetch(response.url);
}
const html = await response.text();
const parser = new DOMParser();
const doc = parser.parseFromString(html, 'text/html');
title = doc.title;
} catch (e) {
title = url;
}
return title;
}