From 02d99a215b07e837cd0b1f1da1df7471588f8ce6 Mon Sep 17 00:00:00 2001 From: makc Date: Fri, 22 Mar 2024 00:11:36 +0400 Subject: fix instagram embeds --- vnext/src/utils/embed.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'vnext') diff --git a/vnext/src/utils/embed.js b/vnext/src/utils/embed.js index 7c1c5c3b..a538a1a8 100644 --- a/vnext/src/utils/embed.js +++ b/vnext/src/utils/embed.js @@ -290,9 +290,10 @@ function getEmbeddableLinkTypes() { re: /https?:\/\/www\.?instagram\.com(\/p\/\w+)\/?/i, makeNode: function(aNode, reResult, div) { let [, postId] = reResult - let mediaUrl = `https://instagr.am${postId}/media` - div.innerHTML = `` - return div + let iframeUrl = `https://www.instagram.com${postId}/embed/captioned/` + let iframe = makeIframe(iframeUrl, '100%', '480px') + iframe.onload = () => makeResizableToRatio(iframe, 1) + return setContent(div, iframe) } }, { -- cgit v1.2.3