The New York Times Article Cleaner JS Snippet is designed to enhance your English language study experience by streamlining the reading process. It achieves this by:
-
Removing Ads and Non-Essential Elements: It eliminates distracting ads and other unnecessary content, leaving only the article text and relevant images.
-
Customizable Themes: It adds a button that lets you toggle between light and dark themes for comfortable reading.
-
Text Formatting: It justifies paragraphs and uses a legible font for improved readability.
-
Text Size: It adds a range slider to allow you to adjust the text size as desired.
-
Note Area: It adds a button that lets you toggle between adding or removing empty areas below each paragraph to take notes.
-
Translate: It includes the Google Translate service in the webpage to translate the article.
-
Audio Isolation: If the New York Times provides an audio reader, the snippet isolates the article audio, allowing you to adjust sound levels and download it as an MP3.
-
PDF Export: It adds a button to save the cleaned article as a PDF directly from your web browser's PDF reader.
(Tip: Save the article in two PDF files, first in English (US) and the second in your native language to compare.)
A snippet is a script embedded into your web browser that can be executed on demand to interact with the current page. In the case of our JavaScript snippet, it's written in ES5 (ECMAScript 5) and allows you to manipulate the content of the New York Times article dynamically.
Warning: Be cautious when using snippets from untrusted sources, as they could potentially include backdoors or malicious code.
To use the snippet:
-
Access the Web Browser DevTools: Open your web browser (such as Chrome or Firefox), navigate to the page with the New York Times article, and open the developer console (usually F12 or Ctrl+Shift+I).
-
Navigate to the "Sources" Tab: In the developer console, switch to the "Sources" tab.
-
Create a New Snippet: Within the "Sources" tab, find the "Snippets" sub-tab. Create a new snippet by clicking the "+" icon.
-
Allow Snippet Creation (First Use): If prompted, allow snippet creation. This ensures you can create and save your custom snippet.
-
Rename Your Snippet: Give your snippet a descriptive name for easy identification.
-
Write or Paste Code: In the snippet editor view, write your JavaScript code or paste an existing snippet.
-
Save the Snippet: Press Ctrl+S (or Cmd+S on macOS) to save your snippet.
-
Execute the Snippet: Right-click on your snippet and select "Run" to execute it. The snippet will clean up the New York Times article on the current page.
Feel free to customize the snippet further based on your preferences!
Before (original)
After (with light mode)
After (with Dark mode)
Before (original)
After (with dark mode)
(with dark mode)
(with dark mode)
(with dark mode)
(with dark mode)
(with light mode)