# Stripe iframe 在我的打印布局上导致空白页面

**URL:** <https://meta.discourse.org/t/stripe-iframe-causes-a-blank-page-on-my-print-layout/362743>\
**Category:** Support\
**Tags:** development\
**Created:** [2025年四月21日 01:34 UTC](https://meta.discourse.org/t/stripe-iframe-causes-a-blank-page-on-my-print-layout/362743 "2025-04-21T01:34:27Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![bitmage](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bitmage/32/389881_2.png) [@bitmage](https://meta.discourse.org/u/bitmage)\
**Post date:** [2025年四月21日 01:34 UTC](https://meta.discourse.org/t/stripe-iframe-causes-a-blank-page-on-my-print-layout/362743/1 "2025-04-21T01:34:27Z")

</div>

Stripe 渲染的 iframe（来自 [Discourse Subscriptions 插件](https://meta.discourse.org/t/discourse-subscriptions/140818)）导致我的打印布局底部出现空白页面。iframe 被硬编码为 `display: block !important`，直接应用在元素上，因此我无法以有意义的方式覆盖样式。

我尝试通过在此路由加载时删除 iframe 来解决此问题。但这不起作用，stripe 脚本会在一段时间后重新添加 iframe。

以下三种解决方案可能有效：

1. 我可以在 stripe 脚本加载之前将其移除（也许可以？）
2. 我可以分叉 subscriptions 代码并添加一个管理员设置，用于指定加载 Stripe 的页面黑名单（或白名单）。
3. 网站布局继承对我 `/print` 路由来说确实不是理想的场景。有什么方法可以让我选择退出，或者设置我自己的布局吗？

第三种方法可以解决多个问题，并且对于将来可能干扰打印布局的其他事物来说是最具前瞻性的。但我不确定更改布局是否会禁用 Stripe 脚本？

该插件在 [plugin.rb](https://github.com/discourse/discourse-subscriptions/blob/33d033c23b37667ba086b11fe0b6eebff2e8e7cd/plugin.rb#L21-L23) 中加载 Stripe。

我最初 [在这里提问](https://meta.discourse.org/t/can-we-use-gjs-for-route-templates/357046/14)。

---

_[View the full topic](https://meta.discourse.org/t/stripe-iframe-causes-a-blank-page-on-my-print-layout/362743)._
