1
0
Fork 0
mirror of synced 2024-06-17 18:04:42 +12:00

Removing some un-necessary duplicated statements.

This commit is contained in:
mike12345567 2022-09-30 14:32:32 +01:00
parent f33968f4da
commit d1c2ca4faa

View file

@ -15,19 +15,11 @@
const url = `${pluginsUrl}/${info.url}`
const resp = await fetch(url, {
headers: {
pragma: "no-cache",
"cache-control": "no-cache",
["pragma"]: "no-cache",
["cache-control"]: "no-cache",
},
})
let text = await resp.text()
// explicitly only want to replace the first instance
if (text.includes("height=")) {
text = text.replace(/height="\d*"/, `height="${size}"`)
}
if (text.includes("width=")) {
text = text.replace(/width="\d*"/, `width="${size}"`)
}
return text
return resp.text()
}
</script>