fix reddit embed height on mobile

master
Aevann 2024-04-08 15:02:24 +02:00
parent 54a263af02
commit 889624f81d
1 changed files with 4 additions and 1 deletions

View File

@ -1,7 +1,10 @@
addEventListener("message", function(t) {
if (typeof t.data == "string" && t.data) {
const data = JSON.parse(t.data)
let height = data.data
if (data && "type" in data && data.type == "resize.embed")
document.getElementById('reddit-embed').height = data.data
if (screen_width < 768)
height += 75
document.getElementById('reddit-embed').height = height
}
})