You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过Google Chrome控制台调用JS脚本移除Reddit的Try the Redesign按钮?

Hey there! Let's get that annoying "Try the Redesign" banner off your Reddit for good, whether you want a one-click fix or something that works automatically—both will replicate the exact effect as running code in the console.

One-Click Quick Fix (Bookmarklet)

This lets you dismiss the banner with a single click whenever it pops up, no need to open the console every time:

  • Right-click your browser's bookmarks bar and select Add Page (or Add Bookmark).
  • For the name, use something like Dismiss Reddit Redesign Banner.
  • For the URL, paste this code:
    javascript:(function(){
        // Try clicking the dismiss button first (matches the console function's effect)
        const dismissBtn = document.querySelector('[data-event-action="r2banner_dismiss"]');
        if (dismissBtn) {
            dismissBtn.click();
        } else {
            // Fallback: Hide the banner entirely if the button isn't found
            const banner = document.getElementById('redesignbanner');
            if (banner) banner.style.display = 'none';
        }
    })();
    
  • Save the bookmark. Now whenever you see the banner, just click this bookmark and it'll be gone instantly.

Permanent Auto-Fix (User Script)

If you want the banner to disappear automatically every time you load Reddit, use a user script manager like Tampermonkey (Chrome/Firefox):

  1. Install Tampermonkey if you haven't already.
  2. Click the Tampermonkey icon and select Create a new script.
  3. Replace the default code with this:
    // ==UserScript==
    // @name         Auto-Remove Reddit Redesign Banner
    // @namespace    Tampermonkey Scripts
    // @version      0.1
    // @description  Automatically gets rid of Reddit's "Try the Redesign" banner on page load
    // @match        *://*.reddit.com/*
    // @grant        none
    // ==/UserScript==
    
    (function() {
        'use strict';
        // Check for the banner every half second until it loads
        const bannerChecker = setInterval(() => {
            const dismissBtn = document.querySelector('[data-event-action="r2banner_dismiss"]');
            const banner = document.getElementById('redesignbanner');
            
            if (dismissBtn) {
                dismissBtn.click(); // Replicates the console function's click action
                clearInterval(bannerChecker);
            } else if (banner) {
                banner.style.display = 'none'; // Fallback if button isn't accessible
                clearInterval(bannerChecker);
            }
        }, 500);
    })();
    
  4. Save the script (Ctrl+S or Cmd+S). From now on, Reddit will load without that banner ever appearing.

Note About the Console Function You Found

The f() function you spotted (function f() { a("redesignbanner", "click", "r2banner_dismiss") }) is tied to the banner's dismiss action, but it's probably wrapped in a closure (meaning you can't call it directly from outside the site's script). That's why using DOM selection to click the button or hide the banner is more reliable—it doesn't depend on accessing internal site functions.

内容的提问来源于stack exchange,提问作者jepjep40

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 03:40:36