From b44848b9185da935592aa1ee2e72cff25fb092ba Mon Sep 17 00:00:00 2001
From: Yury Delendik <ydelendik@mozilla.com>
Date: Thu, 13 Apr 2017 14:48:53 -0500
Subject: [PATCH] Adds special case for origin of blob to the compatibility
 URL.

---
 src/shared/compatibility.js | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/shared/compatibility.js b/src/shared/compatibility.js
index 10a2065c0fe62..f297ed4b34f02 100644
--- a/src/shared/compatibility.js
+++ b/src/shared/compatibility.js
@@ -1812,6 +1812,14 @@ PDFJS.compatibilityChecked = true;
         case 'javascript':
         case 'mailto':
           return 'null';
+        case 'blob':
+          // Special case of blob: -- returns valid origin of _schemeData.
+          try {
+            return new JURL(this._schemeData).origin || 'null';
+          } catch (_) {
+            // Invalid _schemeData origin -- ignoring errors.
+          }
+          return 'null';
       }
       host = this.host;
       if (!host) {