A Chrome extension to hide specific comments on learncpp.com, helping you focus on the comments that are useful and educative.
Note: Currently hides individual comments based on filters. Hiding the entire comment section is coming soon!
- Manual Comment Control: Hide or show comments with one click
- Smart Filtering: Configure which comments to hide based on:
- Author Name: Hide all comments from specific users (exact match)
- Comment Content: Hide comments containing specific text
- Auto-Hide: Automatically hide configured comments when they load (disabled by default, enable in Configuration tab)
- Easy Configuration: User-friendly popup interface to manage your filters
-
Download the latest
.crxfile from the Releases page -
You will see an error: "Package is invalid: CRX_REQUIRED_PROOF_MISSING"
- This is normal for extensions not from the Chrome Web Store
- You can safely dismiss this warning - the source code is open source and available for review
- Workaround: Download the
.crxfile using a command-line tool instead of your browser:orwget https://github.com/daviddanielng/hide_comments_in_cpp.com/releases/download/v*/hide_comments_in_cpp.com-v*.crx
curl -LO https://github.com/daviddanielng/hide_comments_in_cpp.com/releases/download/v*/hide_comments_in_cpp.com-v*.crx
- Note: If you still get the error after downloading via command line, close and reopen Chrome before trying again
- Alternative: If you don't want to use the command line, download the
.tar.xzfile or install from source instead (see options below)
-
Open Chrome and navigate to
chrome://extensions/ -
Enable "Developer mode" in the top right corner
-
Drag and drop the
.crxfile onto the extensions page -
Click "Add extension" when prompted
-
The extension icon should appear in your browser toolbar
-
Download the latest
.tar.xzfile from the Releases page -
Extract the archive:
tar -xf hide_comments_in_cpp.com-v*.tar.xz -
Open Chrome and navigate to
chrome://extensions/ -
Enable "Developer mode" in the top right corner
-
Click "Load unpacked" and select the extracted extension directory
-
The extension icon should appear in your browser toolbar
-
Clone this repository:
git clone https://github.com/daviddanielng/hide_comments_in_cpp.com.git
-
Open Chrome and navigate to
chrome://extensions/ -
Enable "Developer mode" in the top right corner
-
Click "Load unpacked" and select the extension directory
-
The extension icon should appear in your browser toolbar
- Navigate to any page on learncpp.com
- Click the extension icon
- Click "Hide Comments" or "Show Comments"
- Click the extension icon
- Switch to the "Configuration" tab
- Enable "Remove comments on comment load" for automatic hiding
- Click "Add" to create a new filter:
- Name: Hides comments from specific authors (exact match)
- Comment: Hides comments containing the specified text
- Enter the value and click "Save"
- Edit or delete existing filters as needed
When enabled, the extension will automatically hide comments matching your configured filters as they load on the page, including when you scroll and load more comments.
├── manifest.json # Extension configuration
├── popup.html # Popup UI structure
├── popup.js # Popup logic and event handlers
├── content.js # Content script for hiding comments
├── unhide.js # Content script for showing comments
├── background.js # Background service worker
├── icons/ # Extension icons
│ └── icon.png
├── run.sh # Build/deployment script
└── README.md # This file
- Content Scripts: Run on learncpp.com pages to detect and hide/show comments
- Configuration Storage: Uses Chrome's local storage to save your filter preferences
- MutationObserver: Watches for new comments being loaded and auto-hides them based on your settings
- Message Passing: Communicates between popup and content scripts for real-time feedback
activeTab: Access the current learncpp.com tabscripting: Inject content scripts to hide/show commentsstorage: Save your configuration preferences
- Google Chrome or Chromium-based browser
- Basic knowledge of Chrome Extension APIs
- Modify the source files as needed
- Reload the extension in
chrome://extensions/ - Test on learncpp.com
Contributions are welcome! Please feel free to submit a Pull Request.
See LICENSE file for details.
Created to improve the reading experience on learncpp.com by providing a cleaner, less cluttered interface.
Thanks to copilot for writing this README.md file!