name: twitter desc: |- 参数功能需要 Stash iOS/tvOS 3.7+ 或 macOS 4.4+(Beta) 可在覆写详情 → 参数中调整,修改后请刷新已打开的 X 页面 1. 屏蔽广告与推荐(默认开):过滤首页和评论广告、置顶/社区/创作者/关注推荐及 Premium 订阅推广 2. 隐藏新推文提示(默认开) 3. 隐藏「显示 N 帖子」提示(默认关):隐藏时间线顶部的新帖子加载条,刷新页面后可看到新帖子 4. 隐藏顶部导航(默认开):保留桌面左侧导航和移动端搜索页的搜索框 5. 隐藏首页快捷发帖(默认开) 6. 隐藏聊天抽屉(默认开) 7. 隐藏右侧趋势(默认开):保留右侧栏的其他内容 8. 隐藏左侧 Grok 入口(默认开) 9. 隐藏底部 Grok 入口(默认开) 10. 完整隐藏底部导航栏(默认关):仅移动端 11. 上滑隐藏底部导航栏(默认开):下滑或回到顶部时重新显示,仅移动端 12. 隐藏通知入口(默认关):同时作用于移动端底部导航和桌面左侧导航 13. 隐藏对话入口(默认关):同时作用于移动端底部导航和桌面左侧导航 14. 隐藏通知未读数角标(默认关):保留通知入口 15. 隐藏左侧 Premium 入口(默认开) 16. 隐藏左侧 Verified Orgs 入口(默认开) 17. 隐藏左侧 Jobs 入口(默认开) 18. 隐藏账户菜单(默认开) 19. 隐藏 Grok 浮窗(默认开) 20. 隐藏移动端悬浮发帖按钮(默认开) 21. 隐藏回复权限提示(默认开) 22. 隐藏推文 Grok 操作按钮(默认开) 23. 隐藏推文翻译按钮(默认开) 24. 隐藏 Automated 内容块(默认开) 25. 隐藏垃圾回复展开提示(默认开) 26. 自定义阅读列宽度(默认开):桌面宽度至少 1000px 时生效 27. 首页阅读列宽度(默认 65%) 28. 其他页面阅读列宽度(默认 55%) 29. 阅读列居中(默认开):桌面端右侧栏收起时生效 30. 详情页 Esc 返回(默认开) 31. 详情页双击返回(默认关):正文或非交互留白处双击返回上一页;不作用于链接、媒体、回复卡片和输入区 32. 页面布局诊断(默认关):显示「复制诊断信息」按钮 33. CSP 策略(默认移除 CSP):保留 CSP 可能导致页面功能失效 category: ad icon: https://raw.githubusercontent.com/qsoyq/icons/main/assets/icon/x.png arguments-version: 1 arguments: block_ads_and_recommendations: type: switch title: 广告与推荐 · 屏蔽广告与推荐 description: 同时过滤首页和评论广告、置顶/社区/创作者/关注推荐,以及时间线和右侧栏的 Premium 订阅推广;不影响左侧 Premium 导航入口 default: true hide_new_tweets_alert: type: switch title: 页面组件 · 隐藏新推文提示 default: true hide_show_posts_prompt: type: switch title: 页面组件 · 隐藏「显示 N 帖子」提示 description: 隐藏时间线顶部的「显示 N 帖子」加载条;隐藏后不会插入新帖子,刷新页面后可看到 default: false hide_top_nav: type: switch title: 页面组件 · 隐藏顶部导航 description: 隐藏顶部导航组件,保留桌面左侧导航和移动端搜索页的搜索框 default: true hide_home_composer: type: switch title: 页面组件 · 隐藏首页快捷发帖 default: true hide_chat_drawer: type: switch title: 页面组件 · 隐藏聊天抽屉 default: true hide_sidebar_trends: type: switch title: 页面组件 · 隐藏右侧趋势 description: 仅隐藏趋势组件,保留右侧栏的其他内容 default: true hide_nav_grok: type: switch title: 页面组件 · 隐藏左侧 Grok 入口 default: true hide_bottom_grok: type: switch title: 页面组件 · 隐藏底部 Grok 入口 description: 隐藏移动端底部导航的 Grok 入口,不影响左侧入口或 Grok 浮窗 default: true hide_bottom_bar: type: switch title: 底部导航 · 完整隐藏底部导航栏 description: 隐藏移动端底部整条导航栏;桌面端没有底部导航栏,不受影响 default: false hide_bottom_bar_on_scroll: type: switch title: 底部导航 · 上滑隐藏底部导航栏 description: 浏览时向上滑动隐藏移动端底部导航栏,向下滑动或回到顶部时重新显示;开启「完整隐藏底部导航栏」时此项无效 default: true hide_nav_notifications: type: switch title: 底部导航 · 隐藏通知入口 description: 隐藏移动端底部导航和桌面左侧导航中的通知入口 default: false hide_nav_messages: type: switch title: 底部导航 · 隐藏对话入口 description: 隐藏移动端底部导航和桌面左侧导航中的私信/聊天入口 default: false hide_notification_badge: type: switch title: 底部导航 · 隐藏通知未读数角标 description: 仅隐藏通知入口上的未读数量,保留通知入口;同时作用于桌面左侧导航 default: false hide_nav_premium: type: switch title: 页面组件 · 隐藏左侧 Premium 入口 default: true hide_nav_verified_orgs: type: switch title: 页面组件 · 隐藏左侧 Verified Orgs 入口 default: true hide_nav_jobs: type: switch title: 页面组件 · 隐藏左侧 Jobs 入口 default: true hide_account_menu: type: switch title: 页面组件 · 隐藏账户菜单 default: true hide_grok_drawer: type: switch title: 页面组件 · 隐藏 Grok 浮窗 default: true hide_floating_post_button: type: switch title: 页面组件 · 隐藏移动端悬浮发帖按钮 default: true hide_reply_permissions: type: switch title: 页面组件 · 隐藏回复权限提示 default: true hide_grok_actions: type: switch title: 页面组件 · 隐藏推文 Grok 操作按钮 default: true hide_translate_button: type: switch title: 页面组件 · 隐藏推文翻译按钮 default: true hide_automated_content: type: switch title: 页面组件 · 隐藏 Automated 内容块 description: 隐藏 Automated 标记所在的推文内容块,不是仅隐藏标记文字 default: true hide_probable_spam_prompt: type: switch title: 页面组件 · 隐藏垃圾回复展开提示 description: 隐藏 Show probable spam 提示,不自动展开回复 default: true enable_custom_layout: type: switch title: 阅读与操作 · 自定义阅读列宽度 description: 桌面宽度至少 1000px 时使用下方比例,关闭后保留网站原有宽度 default: true home_width_vw: type: input value-type: integer title: 阅读与操作 · 首页阅读列宽度 description: 占视口宽度的百分比,仅在启用自定义阅读列宽度时生效;可用空间不足时自动收缩 default: 65 minimum: 30 maximum: 100 page_width_vw: type: input value-type: integer title: 阅读与操作 · 其他页面阅读列宽度 description: 占视口宽度的百分比,仅在启用自定义阅读列宽度时生效;可用空间不足时自动收缩 default: 55 minimum: 30 maximum: 100 center_primary_column: type: switch title: 阅读与操作 · 阅读列居中 description: 桌面端右侧栏收起时将阅读列居中;右侧栏有可见内容时保留网站列布局,避免重叠 default: true enable_escape_back: type: switch title: 阅读与操作 · 详情页 Esc 返回 description: 在推文详情按 Esc 返回上一页,输入框内不触发 default: true enable_double_tap_back: type: switch title: 阅读与操作 · 详情页双击返回 description: 手机单指快速点两次或鼠标双击正文/非交互留白处,按浏览器历史返回一页;排除链接、媒体、回复卡片、输入区、选中文字及弹窗,不模拟滑动动画;无上一页时不跳转 default: false enable_layout_diagnostics: type: switch title: 高级设置 · 页面布局诊断 description: 在普通浏览器和主屏幕窗口显示「复制诊断信息」按钮;仅点击时采集布局,不包含正文、Cookie 或输入内容,不自动上传;关闭后不注入诊断代码 default: false csp_policy: type: select title: 高级设置 · CSP 策略 description: 保留 CSP 可能阻止页面组件隐藏、布局、Esc 和双击返回功能的注入代码;不影响接口广告与推荐过滤 default: ^https://x\.com/ options: - value: ^https://x\.com/ label: 移除 CSP(允许页面功能) - value: ^$ label: 保留 CSP http: mitm: - x.com force-http-engine: - x.com body-rewrite: - ^https?://x\.com/i/api/graphql/[^/]+/HomeTimeline.*$ response-jq if ${args.block_ads_and_recommendations|json} and (.data.home.home_timeline_urt.instructions|type)=="array" then .data.home.home_timeline_urt.instructions |= map(if (.entries|type)=="array" then .entries |= map(select(.content?.itemContent?.promotedMetadata==null and (.content?.clientEventInfo?.component as $c | ["for_you_pinned","community_to_join","suggest_who_to_subscribe","suggest_who_to_follow","premium-plus-upsell-prompt"] | index($c) | not))) else . end) else . end - ^https?://x\.com/i/api/graphql/[^/]+/HomeTimeline.*$ response-jq if ${args.hide_new_tweets_alert|json} and (.data.home.home_timeline_urt.instructions|type)=="array" then .data.home.home_timeline_urt.instructions |= map(select(.alertType!="NewTweets")) else . end - ^https?://x\.com/i/api/graphql/[^/]+/TweetDetail.*$ response-jq if ${args.block_ads_and_recommendations|json} then walk(if type=="object" and (.entries|type)=="array" then .entries |= map(select(.content?.items[0]?.item?.itemContent?.promotedMetadata==null)) else . end) else . end - ^https://x\.com/i/api/graphql/[^/]+/UserTweets(\?|$) response-jq if ${args.block_ads_and_recommendations|json} then walk(if type=="object" and (.entries|type)=="array" then .entries |= map(select(.content?.clientEventInfo?.component!="suggest_who_to_follow")) else . end) else . end - ^https://x\.com/i/api/graphql/[^/]+/UserTweetsAndReplies(\?|$) response-jq if ${args.block_ads_and_recommendations|json} then walk(if type=="object" and (.entries|type)=="array" then .entries |= map(select(.content?.clientEventInfo?.component!="suggest_who_to_follow")) else . end) else . end header-rewrite: - ${args.csp_policy} response-del content-security-policy script: - name: x binary-mode: false match: https://x.com/ max-size: 2097152 require-body: true timeout: 10 argument: '{"block_ads_and_recommendations":${args.block_ads_and_recommendations|json},"hide_top_nav":${args.hide_top_nav|json},"hide_home_composer":${args.hide_home_composer|json},"hide_chat_drawer":${args.hide_chat_drawer|json},"hide_sidebar_trends":${args.hide_sidebar_trends|json},"hide_nav_grok":${args.hide_nav_grok|json},"hide_bottom_grok":${args.hide_bottom_grok|json},"hide_nav_premium":${args.hide_nav_premium|json},"hide_nav_verified_orgs":${args.hide_nav_verified_orgs|json},"hide_nav_jobs":${args.hide_nav_jobs|json},"hide_account_menu":${args.hide_account_menu|json},"hide_grok_drawer":${args.hide_grok_drawer|json},"hide_floating_post_button":${args.hide_floating_post_button|json},"hide_reply_permissions":${args.hide_reply_permissions|json},"hide_grok_actions":${args.hide_grok_actions|json},"hide_translate_button":${args.hide_translate_button|json},"hide_automated_content":${args.hide_automated_content|json},"hide_probable_spam_prompt":${args.hide_probable_spam_prompt|json},"enable_custom_layout":${args.enable_custom_layout|json},"home_width_vw":${args.home_width_vw|json},"page_width_vw":${args.page_width_vw|json},"center_primary_column":${args.center_primary_column|json},"enable_escape_back":${args.enable_escape_back|json},"enable_double_tap_back":${args.enable_double_tap_back|json},"enable_layout_diagnostics":${args.enable_layout_diagnostics|json},"hide_bottom_bar":${args.hide_bottom_bar|json},"hide_bottom_bar_on_scroll":${args.hide_bottom_bar_on_scroll|json},"hide_nav_notifications":${args.hide_nav_notifications|json},"hide_nav_messages":${args.hide_nav_messages|json},"hide_notification_badge":${args.hide_notification_badge|json},"hide_show_posts_prompt":${args.hide_show_posts_prompt|json}}' type: response debug: false script-providers: x: url: https://raw.githubusercontent.com/qsoyq/stash/main/script/ad/x.js interval: 86400