Sunday, September 4, 2011

DropboxDiff Chrome Extension

DropboxDiff - Compare versions of your Dropbox files in-browser or with your configured diff tool. Trigger from any "Version history" page.


2017-04-18 update (version - Update to match latest Dropbox format change.

2017-03-13 update (versions - Bug fix for diffing non-text files, and files larger than 4K; please get latest "DropboxDiff Helper".

2017-01-26 update (version - Implement "Ignore exit status" option.

2017-01-24 update (versions - Updated installation instructions for Mac/Linux; bug fixes.

I've written DropboxDiff, a Chrome extension which allows you to compare different versions of text files you have on Dropbox.  It basically triggers a diff tool you have installed on your local machine already, which you must configure.
  1. On the Dropbox website, browse to the "Version history" page of any text file.
  2. A "Diff" column has been added where you can select which two versions to compare.
  3. Click the "Diff" button.
    1. If a diff tool is not yet configured, the Options page opens where you can specify one. If you don't have one installed already, one option is KDiff3. The setting is accessible from Tools > Extensions > DropboxDiff > Options.
    2. An additional executable must be installed, DropboxDiff Helper, in order to trigger your diff tool.  Follow the instructions to install.
    3. If configured correctly, your diff tool should open.
This should run on Windows, Mac, and Linux.  Note that the combined file-size limit in any comparison is 4GB.  Please let me know if any issues come up.

Get DropboxDiff.

Release History

2017-01-21 update (version - Support "Load older versions".
2017-01-18 update (version - External diff restored; requires a separate "DropboxDiff Helper" installation.
2017-01-05 update (version - Inline diff restored; external diff support coming soon.  Removed NPAPI requirement, since it is no longer supported.
2014-01-05 update (version - Inline diff implemented.
2014-01-04 update (version - Account for "sjid" parameter in any position.  Distinguish Diff button better.
2013-06-23 update (version - Switch from background page to event page.
2013-01-05 update (version - Fixed to support 64-bit linux.  Added a Test button to the options page.


Robbie said...

Cool tool dude. Would be cool to see it as a firefox extension :p

Vic said...

@Robbie - will make a note of it; thanks for the comment.

will said...

Really nice work on the DropboxDiff Chrome Extension - it's so cool and a real time saver. I can't tell you how many times I've been downloading files from the dropbox website into a temporary folder, then running diffmerge on them. (btw this works great with diffmerge too). So thanks for an excellent extension!

Anonymous said...


Anonymous said...

It's broken on the new site... :(

Vic said...

@Anonymous - I was afraid of that. I'm still waiting for my Dropbox account to be upgraded; I'm still seeing the old version. I'll get a fix out as soon as I can.

Unknown said...

Hey Vic, awesome little tool. Eagerly awaiting the fix for the new site...


Anonymous said...

@Vic - try replacing the with I know that since the upgrade this is the url i'm redirected to.

Vic said...

@Anonymous, yes I tried that but it still redirects.

I contacted Dropbox Support, and this is what they told me:

"We are currently rolling out the new redesign of the Dropbox gradually and don't offer the ability to upgrade user accounts to the new version. We should be upgrading most accounts in the very near future."

If you want to help me out, could you send me the HTML source of one of your "previous versions" pages with DropboxDiff turned off? Then I'd know how to fix it.

Vic said...

Well it looks like my account finally updated to the latest version of the website. But the weird thing is, DropboxDiff still seems to work for me.

Let me know if you are still seeing issues or not. If so, please email me the source of one of your "Previous versions" pages and I'll take a look.

Anonymous said...

Sounds awesome — but do you have any plans for a Safari version?

Vic said...

Re: Safari, no immediate plans, but I will look into it at some point. There is a chance it will be a better platform than Firefox, if its sandboxing is similar to Chrome's.

Anonymous said...

The Chinese characters become Garbled when I use dropboxdiff. but when I use kdiff3 along with the same files downloaded from dropbox, it works.

please email me if you know the reason. Thank you in advance.

Nathan @Questor said...

Does this work on the lastest site?

because I'm getting an error

"Uncaught TypeError: Cannot read property 'cellIndex' of undefined chrome-extension://aefdkgcdokdiaoppobphjogcilaaakka/content.js:143
(anonymous function) chrome-extension://aefdkgcdokdiaoppobphjogcilaaakka/content.js:143
(anonymous function) chrome-extension://aefdkgcdokdiaoppobphjogcilaaakka/content.js:189

I can provide the full HTML of the page if you wish?

Vic said...

@Nathan - thanks for the heads up. Version should fix this. Please let me know if it doesn't work for you.

Nathan @Questor said...

Thanks for the update, but it's still not working, the diff radio boxes and command button appears.

When I click compare (after selecting two files), my compare program (Beyond Compare) opens but the files are wrong.
File 1 = "C:\Users\Nathan\AppData\Local\Temp\dropbox-diff\edited by nathanial davies"
File 2 = ""

I've run the debugger against your extension and grabbed the file object from the diff on click function hope this helps.

files: Object
is_valid: true
left: Object
changed: "↵ Edited by Nathanial Davies↵ ↵ (↵ Nathan-Work↵ )↵ ↵ "
url: ""
__proto__: Object
right: Object
changed: "↵ Edited by Nathanial Davies↵ ↵ (↵ Nathan-Work↵ )↵ ↵ "
url: ""
__proto__: Object

I hope the formatting on that works, do you need any more info?


Victor Shih said...

@Nathan, whoops, forget Version should work on Windows.

Nathan @Questor said...

It's working brilliantly, thank you soo much.


Jon said...

have you considered integrating it with an in-browser diff tool like this?

Victor Shih said...

@Jon, yes, it's in the queue. So far I was considering but I'll take a look at Pretty-Diff too; thanks for the input.

Sven said...

Victor, great tool, I've used it for a few weeks now and it's been very helpful. I've now got windows 8 however and "This application is not supported on this computer. Installation has been disabled" at the chrome web store.
Search reveals something about using Tincr and it no longer available from win8?

Anyway, just a heads up.

Victor Shih said...

@Sven, thanks! Yes, it appears this type of extension is not allowed in Windows 8, but supposedly you can work around it by running Chrome in compatibility mode for Windows 7. Something like: right-click the Chrome shortcut > Properties > Compatibility > "Run this program in compatibility mode for:". Reference is here (which you probably already saw).

An in-browser diff tool is on my list of things to do, but I haven't been able to get around to it...

bruha said...

Test run from extension options page is ok. But got error when press Diff button on Dropbox site:

Victor Shih said...

@bruha, I'll look into it when I get the chance, probably this weekend.

Victor Shih said...

@bruha, I do get that error once in a while; it seems that the event page gets deactivated after a period of inactivity. But if I try clicking Diff a second time, it usually works.

I assume you are on the latest version of Chrome; what OS are you on? I tested on the latest version of Chrome on Windows 7, Mac 10.6, and Ubuntu 12.04.1.

bruha said...

I tried today and it works just fine. Maybe quistion was in browser restart. My OS is Win7x64 and Chrome 29.0.1547.57 m

Victor Shih said...

Glad to hear, and thanks for the follow-up!

Rüdiger Plantiko said...


thank you - a great and useful tool!

The more I am unhappy that it ceases to work after my latest system, Chrome and dropbox update (this morning) in ubuntu 12.04.

The "Diff" button disappeared completely.

I am not 100% sure whether the following console error is the cause of the problem, but it looks like a good hit:

The JavaScript content.js breaks at line 121

var sjid = REV_RE.exec(content)[2]

Here, REV_RE is the expression


to be applied to the HTML of the cells of the current line, containing the hyperlink to the version with the href


As you see, this doesn't match, since the sjid now is the first query parameter, but the regex asks for a preceding &.

Suggestion: Simplify REV_RE to

REV_RE = /sjid=([0-9]+)/

(and grab the first submatch then, of course:

var sjid = REV_RE.exec(content)[1]

I have no idea why the order of the arguments in the version URL changed. But clearly it is allowed to change the order of query parameters in any way.


Victor Shih said...

@Rüdiger, thanks for the detailed bug report! I just published version which should address this issue; please let me know if it doesn't.

Rüdiger Plantiko said...

Victor, thanks for the quick update. Yes, it works again for me! (You were more "cautious" with the RegExp than I suggested... OK, it's your code after all :-) ). Regards, Rüdiger

Anonymous said...

Hi Victor, thanks for making this extension. It has been very helpful. Lately I have been getting an error:

DropboxDiff failed with
The JavaScript console of DropboxDiff's "background.html" page may have more information.

I am wondering if you can take a look at this. Thanks!

Victor Shih said...

@Anonymous, it looks like NPAPI has finally been completely deprecated by Chrome as of September 2015: I will need to look into the alternatives available at some point. Sorry!

Anonymous said...


The Chrome Webstore description says:
Note that this extension requires access to "All data on your computer and the websites you visit" because the only way to trigger your locally-installed diff tool is through an NPAPI plugin.

It also says:
[DropboxDiff] Provides two options for comparing different versions of your Dropbox files: 1) a side-by-side diff within your browser, or 2) an external diff tool.

Would you be willing publish a reduced version of DropboxDiff that supports only the option 1) "a side-by-side diff within your browser." Hopefully, this option does not require the NPAPI plugin.


Victor Shih said...

@Anonymous, good idea! I'll work on it when I get the chance.

Anonymous said...

Any updates!?

Victor Shih said...

Ah yes, sorry. I got stuck while trying to implement an alternative around the NPAPI deprecation so I set this aside for a while. I'll take a look at doing just inline diff over the holidays.

Victor Shih said...

Okay, DropboxDiff is back, somewhat at least. Inline diff is restored, but external diff is still to come.

Victor Shih said...

External diff functionality restored.

Anonymous said...

Really want to use this, but it is just not working. Using Win7Pro with Chrome
- Installed the Dropbox Diff extension and confirmed it is enabled
- Installed the Dropboxdiff-Helper
- Installed the kdiff3 tool, and made sure the command line points to the executable file, and confirmed kdiff3 opens when clicking the test button in the DropboxDiff Extension options.
- confirmed that in Dropbox, at the Version History page, I get the Dropbox Diff info (radio buttons, etc.)

However, when I select radio buttons for the left and right, and then click either "Diff" or "inline" nothing happens. Neither works.

Any suggestions/ideas on what I may be doing wrong? I REALLY want this to work.

Victor Shih said...

There are some extra error checking steps I need to add; hopefully this will reveal some issues. Thanks for the attempt and I'll keep you posted.

Victor Shih said...

Okay I've just pushed which fixes a bug when diffing non-plaintext files, and another one with files over 4K. Please reinstall the DropboxDiff Helper. Hopefully that was your issue, latest Anonymous. Also, there's some better error handling, so if that's not it, maybe it will shed some more light.

Victor Shih said...

Dropbox changed their site again. I'm working on an update.

Victor Shih said... released, which handles Dropbox's latest format change.