diff --git a/src/Linkification/Embedding.coffee b/src/Linkification/Embedding.coffee index dad7056ea..69c355877 100644 --- a/src/Linkification/Embedding.coffee +++ b/src/Linkification/Embedding.coffee @@ -9,7 +9,12 @@ Embedding = <%= readHTML('Embed.html') %> @media = $ '#media-embed', @dialog $.one d, '4chanXInitFinished', @ready - + $.on d, 'IndexRefreshInternal', -> + g.posts.forEach (post) -> + for post in [post, post.clones...] + for embed in post.nodes.embedlinks + Embedding.cb.catalogRemove.call embed + return if Conf['Link Title'] $.on d, '4chanXInitFinished PostsInserted', -> for key, service of Embedding.types when service.title?.batchSize @@ -55,8 +60,8 @@ Embedding = embed.dataset[name] = value for name, value of {key, uid, options, href} $.on embed, 'click', Embedding.cb.click - $.on d, 'IndexRefreshInternal', Embedding.cb.catalogRemove.bind(embed) if Index.enabled $.after link, [$.tn(' '), embed] + post.nodes.embedlinks.push embed if Conf['Auto-embed'] and !Conf['Floating Embeds'] and !post.isFetchedQuote if $.hasClass(doc, 'catalog-mode') diff --git a/src/classes/Post.coffee b/src/classes/Post.coffee index 531eb6046..4419f3500 100644 --- a/src/classes/Post.coffee +++ b/src/classes/Post.coffee @@ -85,6 +85,7 @@ class Post comment: $ '.postMessage', post quotelinks: [] archivelinks: [] + embedlinks: [] # XXX Edge invalidates HTMLCollections when an ancestor node is inserted into another node. # https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7560353/