diff --git a/src/webpage/channel.ts b/src/webpage/channel.ts index 2dace1e..b10a093 100644 --- a/src/webpage/channel.ts +++ b/src/webpage/channel.ts @@ -1453,7 +1453,9 @@ class Channel extends SnowFlake { this.fakeMessages = this.fakeMessages.filter((_) => _[0] !== message[0]); message[1].remove(); for (const {url} of message[0].attachments) { - URL.revokeObjectURL(url); + try { + URL.revokeObjectURL(url); + } catch {} } this.fakeMessageMap.delete(id); } diff --git a/src/webpage/file.ts b/src/webpage/file.ts index 6663eb6..1ac1af8 100644 --- a/src/webpage/file.ts +++ b/src/webpage/file.ts @@ -37,6 +37,8 @@ class File { } OSpoiler ||= this.filename.startsWith("SPOILER_"); const src = this.proxy_url || this.url; + this.width ||= 1000; + this.height ||= 1000; if (this.width && this.height) { let scale = 1; const max = 96 * 3; @@ -67,8 +69,8 @@ class File { img.src = src; div.append(img); if (this.width && !fullScreen) { - div.style.width = this.width + "px"; - div.style.height = this.height + "px"; + div.style.maxWidth = this.width + "px"; + div.style.maxHeight = this.height + "px"; } if (!fullScreen) { if (OSpoiler) { diff --git a/src/webpage/style.css b/src/webpage/style.css index 72204ac..d8f3870 100644 --- a/src/webpage/style.css +++ b/src/webpage/style.css @@ -1106,6 +1106,7 @@ span.instanceStatus { background: var(--blank-bg); border-radius: 8px; overflow: hidden; + height: 192px; } .messageimgdiv { height: 100%;