diff --git a/src/social-network-provider/twitter.com/ui/fetch.ts b/src/social-network-provider/twitter.com/ui/fetch.ts index f4507c8e3b7..af55f994315 100644 --- a/src/social-network-provider/twitter.com/ui/fetch.ts +++ b/src/social-network-provider/twitter.com/ui/fetch.ts @@ -57,8 +57,6 @@ const registerPostCollector = (self: SocialNetworkUI) => { new MutationObserverWatcher(postsSelectors()) .useForeach((node, _, proxy) => { const info = getEmptyPostInfo(postsRootSelector()) - // push to map - self.posts.set(proxy, info) const collectPostInfo = () => { const r = postParser(node) if (!r) return @@ -75,6 +73,8 @@ const registerPostCollector = (self: SocialNetworkUI) => { info.postContent.addListener(newValue => { info.postPayload.value = deconstructPayload(newValue, self.payloadDecoder) }) + // push to map + self.posts.set(proxy, info) return { onNodeMutation: collectPostInfo, onTargetChanged: collectPostInfo, diff --git a/src/social-network-provider/twitter.com/worker/fetch.ts b/src/social-network-provider/twitter.com/worker/fetch.ts index 6b25e2e05c2..423e523a2d9 100644 --- a/src/social-network-provider/twitter.com/worker/fetch.ts +++ b/src/social-network-provider/twitter.com/worker/fetch.ts @@ -11,6 +11,7 @@ export const fetchPostContent = async (post: PostIdentifier) = // it will be a false-positive and it is dangerous. // There is a build-in parser. // Checkout http://mdn.io/DOMParser and we're already using it. + // Legacy js-free mobile twitter may help. const content = twitterWorkerSelf.publicKeyDecoder(d.innerText) if (content && content[0].length) return content[0] return tasks(toPostUrl(post), {}).getPostContent(post)