GitHub Diff Navigator allows you to easily navigate through the changes in a file that has been edited on GitHub.

Latest Version

Version
1.0
Update
April 28, 2023
Size
43.72KiB
Developer
deanattali.com
Category
Users
205
Rating
5 ★
Manifest Version
2
Web Store Status
Languages Support
English
See more
Permissions
DeclarativeContent
See more

Diff Navigator for GitHub Extension

Code available at: https://github.com/daattali/github-diff-navigator-extension/

Description
=========

This is a Chrome extension that allows you to easily navigate through the changes in a file that has been edited on GitHub.

You may have noticed that after editing a file through GitHub and previewing your changes, there is no easy way to navigate through the changes in a nice \"next/previous change\" manner. Most file formats only show the lines that were changed and several surrounding lines, so it's usually not a terrible inconvenience, but for any markdown document (.md) the situation is different. GitHub shows the entire markdown document when previewing the changes made, which means that if you're making a few tiny edits to a large document, it's very hard to find those edits and see what's changed. Rmarkdown (.Rmd) documents behave similarly, and potentially other markdown-type documents as well.

Enter: GitHub Diff Navigator.


Motivation
=========

The idea for this extension came when I was reading through Hadley Wickham's Advanced R book. Every time I found a few typos in a chapter (which is a single markdown document), I would edit it on GitHub and make a pull request.
To make sure I didn't make an idiot out of myself, I wanted to double-check my edits in the Preview tab, but I noticed the problem described above. I didn't trust my eyes in finding the few edits in such large files, and I ended up using the DOM + JavaScript console to help me find where the edits were.
Then I decided that playing in the JavaScript console wasn't hardcore enough and I decided to spend the next two days making an extension that will help me find such changes quickly in the future.


Features
=========

- GitHub Diff Navigator is non-intrusive and will only show up when looking at the Preview of edits made on a file using GitHub.
- GitHub Diff Navigator will not take up any resources or show up in Chrome's Task Manager when you don't have a valid GitHub edited page open.
- Works with multiple GitHub tabs that are open simultaneously (every time you switch tabs, the extension will update to show you the edits in that tab).
- Automatically detect whether the file being edited is markdown-type or not, and seamlessly works for both.
- Clean and intuitive UI with helpful messages shown when no edits are found.


Disclaimer
=========

I would not advise using my code as a template or resource for learning how to write Chrome extensions. I learned how to write the extension and fully built it within two days, so I'm not sure what the best practices are and how to properly organize the code. It was just an excuse to test out how Chrome extensions work. I also left a little bit of ugly code in there -- please dont judge :)
Read more

Source Manifest.json

{"update_url": "https://clients2.google.com/service/update2/crx", "name": "Diff Navigator for GitHub", "version": "1.0", "manifest_version": 2, "description": "GitHub Diff Navigator allows you to easily navigate through the changes in a file that has been edited on GitHub.", "page_action": { "default_title": "Diff Navigator for GitHub", "default_popup": "html/popup.html" }, "background": { "scripts": ["js/background.js"], "persistent": false }, "permissions" : [ "declarativeContent" ], "icons": { "16": "img/icon-16.png", "48": "img/icon-48.png", "128": "img/icon-128.png" }, "content_scripts": [ { "matches": [ "https://github.com/*/edit/*", "http://github.com/*/edit/*" ], "js": [ "js/githubDiffNav.js" ] } ], "homepage_url": "https://github.com/daattali/github-diff-navigator-extension"}
Read more

Similar Extensions

icon

OctoPermalinker Extension · Developer Tools 205 1 ★ 373KiB

icon

OctoLenses Extension · Developer Tools 205 3 ★ 3.74MiB

icon

GitHub Enhancement Suite Extension · Developer Tools 205 1 ★ 56.24KiB

icon

Github Super Search Extension · Developer Tools 205 0 ★ 46.74KiB

icon

Where is it? Extension · Developer Tools 205 3 ★ 653KiB

icon

Pages2Repo Extension · Productivity 205 3 ★ 213KiB

icon

Package Hub Extension · Developer Tools 205 2 ★ 28.3KiB

icon

OctoEdit Extension · Developer Tools 205 0 ★ 1.16MiB

icon

Codeflower Extension · Developer Tools 205 2 ★ 246KiB

icon

Github diff helper Extension · Developer Tools 205 3 ★ 137KiB

icon

Git flow (for Github) Extension · Developer Tools 205 1 ★ 218KiB

icon

GitHub submodule links Extension · Developer Tools 205 2 ★ 17.49KiB

icon

Github Annotator Extension · Developer Tools 205 2 ★ 81.68KiB

icon

Builds Tab for Github Extension · Developer Tools 205 0 ★ 160KiB

icon

github-find Extension · Productivity 205 1 ★ 40.7KiB

icon

Github Package.json Enhancer Extension · Developer Tools 205 0 ★ 18.89KiB

icon

Git Help Extension · Developer Tools 205 5 ★ 744KiB

icon

Table of Contents for GitHub Extension · Developer Tools 205 4 ★ 11.44KiB

icon

Markdown Menu for GitHub Extension · Developer Tools 205 9 ★ 5.8KiB

icon

GitHub Issue Link Status Extension · Developer Tools 205 12 ★ 629KiB

icon

GitHub Highlight Selected Extension · Developer Tools 205 17 ★ 156KiB

icon

github npm stats Extension · Developer Tools 205 4 ★ 65.86KiB

icon

GitHub Code Folding Extension · Developer Tools 205 16 ★ 1.06MiB

icon

Github Toc Extension · Developer Tools 205 7 ★ 704KiB

User reviews

icon

Keshini D. (ID: 00000001b53b9eb8) Voted 5 ★ - Updated 01/10/2015 This extension is extremely helpful and useful!!

icon

Justin Chu (ID: 000000613b43e5c9) Voted 5 ★ - Updated 01/08/2015 Useful for large markdown documents!