# Twitter 原生嵌入

**URL:** https://meta.discourse.org/t/twitter-native-embed/261792
**Category:** Theme component
**Created:** [2023年四月15日 12:35 UTC](https://meta.discourse.org/t/twitter-native-embed/261792 "2023-04-15T12:35:49Z")
**Posts on this page:** 20
**Page:** 4

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [2023年十月29日 15:57 UTC](https://meta.discourse.org/t/twitter-native-embed/261792/61 "2023-10-29T15:57:04Z")

</div>

这个主题似乎导致了一些 UI/UX 问题。

当你进入包含推文的主题时，你会从最后一个未读帖子的入口被强制跳转开，需要再次手动向下滚动页面才能回到你想要进入的那个点。

我怀疑这是因为推文内容在页面内容加载时是动态构建的。

还有其他人遇到这种情况吗？

强制设置固定高度是否可以解决这个问题？ 🤔

---

<div class="post-metadata">

### Author: ![Firepup650](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/firepup650/32/465200_2.png) [@Firepup650](https://meta.discourse.org/u/Firepup650)
#### Post date: [2023年十月30日 04:42 UTC](https://meta.discourse.org/t/twitter-native-embed/261792/62 "2023-10-30T04:42:20Z")

</div>

> [@Richie](#):
>
> 当您进入包含推特帖子的主题时，您会被强制从最后一个未读帖子的进入点跳开，并且需要手动再次向下滚动页面才能到达您预期的进入点。

我可能错了，但这会不会是页面随机跳转问题的延续？

> [@Discourse jumps back 20 posts in post history when navigating to new topic, again](https://meta.discourse.org/t/discourse-jumps-back-20-posts-in-post-history-when-navigating-to-new-topic-again/279238/23):
>
> I’m receiving feedback from users having multiple reports of experiencing this issue on latest-release branch (3.2.0.Beta2) on mobile. If we can help in any way to identify the issue, please let us know.

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [2023年十月30日 06:20 UTC](https://meta.discourse.org/t/twitter-native-embed/261792/63 "2023-10-30T06:20:39Z")

</div>

感谢 @Firepup650，但我们只在包含指向 Twitter / X 的链接的主题中看到此问题。

---

<div class="post-metadata">

### Author: ![Jongin](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@Jongin](https://meta.discourse.org/u/Jongin)
#### Post date: [2023年十二月16日 12:48 UTC](https://meta.discourse.org/t/twitter-native-embed/261792/64 "2023-12-16T12:48:14Z")

</div>

它不再起作用了……

---

<div class="post-metadata">

### Author: ![ninermac](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ninermac/32/135729_2.png) [@ninermac](https://meta.discourse.org/u/ninermac)
#### Post date: [2023年十二月16日 14:36 UTC](https://meta.discourse.org/t/twitter-native-embed/261792/65 "2023-12-16T14:36:26Z")

</div>

我的网站上也有同样的情况。这真是一种爱恨交织的关系，与推特/X。

---

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [2023年十二月16日 17:22 UTC](https://meta.discourse.org/t/twitter-native-embed/261792/66 "2023-12-16T17:22:26Z")

</div>

我已经检查了情况。问题不在我这里，而在推特。

推特的嵌入服务坏了。[Twitter Publish](https://publish.twitter.com/#) 本身现在也无法工作。

> **离题抱怨**
>
> 我已经被推特逃离到fediverse一段时间了，老实说推特太糟糕了。
> 
> 我真的不知道他们在做什么。

---

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [2023年十二月17日 22:22 UTC](https://meta.discourse.org/t/twitter-native-embed/261792/67 "2023-12-17T22:22:27Z")

</div>

请问您在使用什么客户端或协议？推特就像 Reddit 和 Facebook 一样被关闭了，大公司正在扼杀人类互动。

我对 Nostr 感兴趣，但我们的社区有很多嵌入式内容，我希望我们能够展示它们，而无需截图并删除所有到他们邪恶系统的流量。

_如果他们别无选择，我们将乐意这样做。_

---

<div class="post-metadata">

### Author: ![REALITY](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/reality/32/199798_2.png) [@REALITY](https://meta.discourse.org/u/REALITY)
#### Post date: [2023年十二月17日 23:02 UTC](https://meta.discourse.org/t/twitter-native-embed/261792/68 "2023-12-17T23:02:59Z")

</div>

现在一切似乎都运行正常。 🤷‍♂️ 😆

---

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [2023年十二月19日 09:23 UTC](https://meta.discourse.org/t/twitter-native-embed/261792/69 "2023-12-19T09:23:29Z")

</div>

我正在使用 [Firefish](https://joinfirefish.org/#)，这是一款使用 ActivityPub 协议互联的社交网络软件，可以与 Mastodon 进行交互。

---

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [2024年四月12日 13:34 UTC](https://meta.discourse.org/t/twitter-native-embed/261792/70 "2024-04-12T13:34:39Z")

</div>

所以，没有更多的变通方法了？

_我真的很讨厌这些破事，也讨厌我自己被冲昏头脑，妄想地认为这家公司会和 FB 或其他任何公司有所不同。_

---

<div class="post-metadata">

### Author: ![traceymoko](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/traceymoko/32/483235_2.png) [@traceymoko](https://meta.discourse.org/u/traceymoko)
#### Post date: [2024年五月8日 12:55 UTC](https://meta.discourse.org/t/twitter-native-embed/261792/71 "2024-05-08T12:55:08Z")

</div>

我安装了这个主题组件并按照说明调整了设置——它似乎允许我嵌入原生的 Twitter 内容。

---

<div class="post-metadata">

### Author: ![Roi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roi/32/130587_2.png) [@Roi](https://meta.discourse.org/u/Roi)
#### Post date: [2024年五月8日 17:33 UTC](https://meta.discourse.org/t/twitter-native-embed/261792/72 "2024-05-08T17:33:18Z")

</div>

刚刚也安装了。我这里也无法工作。我只看到 [twitter.com](http://twitter.com) 链接，仅此而已…… 🙁

---

<div class="post-metadata">

### Author: ![Roi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roi/32/130587_2.png) [@Roi](https://meta.discourse.org/u/Roi)
#### Post date: [2024年五月8日 22:46 UTC](https://meta.discourse.org/t/twitter-native-embed/261792/73 "2024-05-08T22:46:37Z")

</div>

抱歉，我得自我纠正一下。它能用。但在我的Windows桌面上的主浏览器Opera中不行。但在iPad上的PWA中可以。

也许也可能是我在Opera中使用的某个插件。我还没检查。但我想确保主题组件仍然可用，这更多是一个客户端问题。

---

<div class="post-metadata">

### Author: ![traceymoko](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/traceymoko/32/483235_2.png) [@traceymoko](https://meta.discourse.org/u/traceymoko)
#### Post date: [2024年五月10日 03:43 UTC](https://meta.discourse.org/t/twitter-native-embed/261792/74 "2024-05-10T03:43:56Z")

</div>

你说得对，它在我的 iPad 上可以运行，但在我的台式机（Mac Safari）上不行。

---

<div class="post-metadata">

### Author: ![whitewaterdeu](https://avatars.discourse-cdn.com/v4/letter/w/57b2e6/32.png) [@whitewaterdeu](https://meta.discourse.org/u/whitewaterdeu)
#### Post date: [2024年六月10日 02:57 UTC](https://meta.discourse.org/t/twitter-native-embed/261792/75 "2024-06-10T02:57:45Z")

</div>

很好用，谢谢楼主，要是内容上面的链接能消失就更好了（现在这样也能用，已经很棒啦！

> **[zlibrary官网 official zlibrary project（长期更新](https://forum.beginner.center/t/topic/685)**
>
> Z-Library（简称Z-Lib，前身为BookFinder）是一个影子图书馆和开放获取文件分享计划，用户可在此一网站上下载期刊文章以及各种类型的书籍。根据Z-Library的说法，截至2022年6月12日，其共收录了10,456,034本书和84,837,646篇文章。Z-Library在其电子书搜索页面上宣称自己是“全球最大的数字图书馆”，并在文章搜索页面上称自身是“全球最大的科学文章存储库”。它原是创世纪图书馆的镜像网站，并从该图书馆获得大部分馆藏。但它的一些馆藏由用户自行上传，并...

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/0/8/708eabb0dc7dee90a2739e8d8351ffa9033b7c56.png)

---

<div class="post-metadata">

### Author: ![GetReadyMan](https://avatars.discourse-cdn.com/v4/letter/g/bbe5ce/32.png) [@GetReadyMan](https://meta.discourse.org/u/GetReadyMan)
#### Post date: [2024年六月16日 11:56 UTC](https://meta.discourse.org/t/twitter-native-embed/261792/76 "2024-06-16T11:56:04Z")

</div>

是的，在我的 iPhone 上可以正常工作，但在我的台式机上（Windows，Firefox）不行。

重启了所有东西后，现在可以正常工作了！谢谢！

---

<div class="post-metadata">

### Author: ![Gotchur](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gotchur/32/424926_2.png) [@Gotchur](https://meta.discourse.org/u/Gotchur)
#### Post date: [2024年七月16日 05:32 UTC](https://meta.discourse.org/t/twitter-native-embed/261792/77 "2024-07-16T05:32:38Z")

</div>

> [@whitewaterdeu](#):
>
> 很好用，谢谢楼主，要是内容上面的链接能消失就更好了（现在这样也能用，已经很棒啦！

你是否需要做些特别的事情才能让它对你起作用？

---

<div class="post-metadata">

### Author: ![whitewaterdeu](https://avatars.discourse-cdn.com/v4/letter/w/57b2e6/32.png) [@whitewaterdeu](https://meta.discourse.org/u/whitewaterdeu)
#### Post date: [2024年七月29日 10:06 UTC](https://meta.discourse.org/t/twitter-native-embed/261792/78 "2024-07-29T10:06:07Z")

</div>

只需粘贴推特的链接，例如  
`https://x.com/TeresaSegotta4/status/1798746828156121348`

它将自动转换

---

<div class="post-metadata">

### Author: ![Yt.w](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yt.w/32/348367_2.png) [@Yt.w](https://meta.discourse.org/u/Yt.w)
#### Post date: [2024年八月14日 07:25 UTC](https://meta.discourse.org/t/twitter-native-embed/261792/79 "2024-08-14T07:25:01Z")

</div>

此插件在 3.3.0 版本上也可用吗？  
我尝试添加内容安全策略，但它不起作用

 ![image](https://global.discourse-cdn.com/meta/original/4X/0/e/7/0e71ad618e6969ecdc6526c4ee6f777fe1b101d1.png)

---

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [2024年八月14日 07:33 UTC](https://meta.discourse.org/t/twitter-native-embed/261792/80 "2024-08-14T07:33:02Z")

</div>

它肯定仍然有效。您是否尝试过按照此帖子中的说明禁用 Twitter 的 onebox？这可能会奏效。

在实际测试之后，您不一定需要添加该内容安全策略……我不确定。

> [@Twitter Native Embed](https://meta.discourse.org/t/twitter-native-embed/261792/28):
>
> Alright +1. I tested, and if oneboxes don’t work well (like, not showing media), then you must add twitter.com in blocked onebox domains in order for the component to work. slight_smile From: To: I didn’t use the theme component widely and didn’t encounter the issue, but my guess is that Discourse doesn’t know how tall will be a Twitter iframe before the content is loaded. When the iframe loads, it pushes the content arround it, creating this behavior. Can you captu…

[上一頁](https://meta.discourse.org/t/twitter-native-embed/261792.md?page=3)

[下一頁](https://meta.discourse.org/t/twitter-native-embed/261792.md?page=5)
