Image for post

I remember myself running the same script in my Chrome Console. Thanks to Chrome Dev Tool Snippets, now you can save and run your favorite and frequently used code snippets on any sites in Chrome. The good thing is that these snippets are aware of the Javascript Context of the page.

For this article, I wrote a script that will bring Dark Theme to Medium web.

Image for post

Javascript Snippet for Medium Dark Theme

First, we add the above snippet in Chrome and see if it is working.

  1. Open Chrome Dev Tool by pressing Ctrl + Shift + Ins or Right-click and select Inspect.

Image for post

Open Dev Tools

2. Click on the **Sources **Tab. You can see a list of options on the left like Page, Filesystem, Overrides, etc.

Image for post

Switch to Sources Tab

3. Click the **» **button and select Snippets.

Image for post

Select Snippets Option

#javascript #web #dark-mode #devtools #chrome #programming

Running Javascript Snippets in Chrome Dev Tools
2.15 GEEK