hypothesis/h — pull request #1753 by csillag (2014-12-03 18:55:35+00:00)
Title: Consolidate code paths around deciding about PDF.js

Annotator's PDF.js plugin replaces the document plugin
for PDF.js, so when we are using the PDF plugin, we
don't want to load the document plugin.

For this, we are removing it from the options, in
presence of PDF.

This commit changes how we test for PDF.

Earlier, we were simply testing for the presence of the
global PDF.js object, but it's better to actually
use the test [already implemented](https://github.com/hypothesis/annotator/blob/ecc323e43bbc94313bf3a0d8b9e1fc18a94afc1f/src/plugin/pdf.coffee#L4) inside the PDF plugin.

This has two benefits:
* If the PDF plugin is not present, we won't
mistakenly remove the document plugin.
* If the PDF plugin decides that it can't deploy,
for whatever reason, we won't
mistakenly remove the document plugin.