求能移除指定网页body/html标签CSS类的Chrome插件
Hey there! I’ve dealt with exactly this kind of scenario before—when a website’s update breaks the familiar UI, and a simple class removal fixes everything. Here are my top picks for Chrome extensions that’ll get the job done:
1. Tampermonkey (User Scripts)
This is the most flexible option, as it lets you run custom JavaScript to directly manipulate the DOM and strip out unwanted classes. Perfect for your bank website use case:
- Install Tampermonkey from the Chrome Web Store
- Click the Tampermonkey icon in your toolbar and select "Create a new script"
- Replace the default template with this custom script (make sure to update the
@matchURL to your bank’s actual domain):
// ==UserScript== // @name Restore Bank Site Old UI // @namespace http://tampermonkey.net/ // @version 0.1 // @description Removes 'lifting' class from html and body tags // @author Your Name // @match https://your-bank-domain.com/* // @grant none // ==/UserScript== (function() { 'use strict'; // Remove 'lifting' class from html tag document.documentElement.classList.remove('lifting'); // Remove 'lifting' class from body tag document.body.classList.remove('lifting'); })();
- Save the script, then refresh your bank website. The
liftingclass will be stripped from both tags instantly, and the old UI should load right up.
2. User JavaScript and CSS
If you prefer a simpler interface without Tampermonkey’s full template system, this extension lets you inject custom JS/CSS directly into specific sites:
- Install the extension, navigate to your bank website
- Click the extension icon, switch to the "JavaScript" tab
- Paste this code and save:
document.documentElement.classList.remove('lifting'); document.body.classList.remove('lifting');
- From now on, every time you visit the site, this code runs automatically to remove the unwanted class.
3. Stylus (Alternative: Override Class Styles)
While Stylus is primarily for customizing CSS, if removing the class doesn’t work as expected (or if you just want to neutralize the styles added by lifting), you can use it to override the class’s effects:
- Install Stylus, open your bank site, click the extension icon and select "Write style for [your bank domain]"
- Add this CSS to cancel out the
liftingclass styles (adjust based on what the class actually modifies):
html.lifting, body.lifting { /* Reset layout changes from the 'lifting' class */ width: auto !important; margin: 0 !important; /* Add other resets for fonts, spacing, or colors as needed */ }
- Save the style, and it’ll apply every time you visit the site to mimic the old UI.
All these options are free, trusted, and work reliably for this exact problem. Tampermonkey’s my go-to because it’s super flexible for any future DOM tweaks you might need!
内容的提问来源于stack exchange,提问作者mateuszms

