소스 검색

PDF.js version 1.6.313 - See mozilla/pdf.js@c23f124051b5e1a81a411c9e890a4efd5c237cf2

Pdf Bot 8 년 전
부모
커밋
b8f6fc2dbe
5개의 변경된 파일54개의 추가작업 그리고 8개의 파일을 삭제
  1. 1 1
      bower.json
  2. 25 2
      build/pdf.combined.js
  3. 2 2
      build/pdf.js
  4. 25 2
      build/pdf.worker.js
  5. 1 1
      package.json

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "pdfjs-dist",
-  "version": "1.6.311",
+  "version": "1.6.313",
   "main": [
     "build/pdf.js",
     "build/pdf.worker.js"

+ 25 - 2
build/pdf.combined.js

@@ -24,8 +24,8 @@
 }(this, function (exports) {
   // Use strict in our context only - users might not want it
   'use strict';
-  var pdfjsVersion = '1.6.311';
-  var pdfjsBuild = '2f5170f';
+  var pdfjsVersion = '1.6.313';
+  var pdfjsBuild = 'c23f124';
   var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null;
   var pdfjsLibs = {};
   (function pdfjsWrapper() {
@@ -53891,6 +53891,29 @@
                 resultObj.action = namedAction.name;
               }
               break;
+            case 'JavaScript':
+              var jsAction = action.get('JS'), js;
+              if (isStream(jsAction)) {
+                js = bytesToString(jsAction.getBytes());
+              } else if (isString(jsAction)) {
+                js = jsAction;
+              }
+              if (js) {
+                // Attempt to recover valid URLs from 'JS' entries with certain
+                // white-listed formats, e.g.
+                //  - window.open('http://example.com')
+                //  - app.launchURL('http://example.com', true)
+                var URL_OPEN_METHODS = [
+                  'app.launchURL',
+                  'window.open'
+                ];
+                var regex = new RegExp('^(?:' + URL_OPEN_METHODS.join('|') + ')' + '\\((?:\'|\")(\\S+)(?:\'|\")(?:,|\\))');
+                var jsUrl = regex.exec(stringToPDFString(js), 'i');
+                if (jsUrl && jsUrl[1]) {
+                  url = jsUrl[1];
+                  break;
+                }
+              }
             default:
               warn('Catalog_parseDestDictionary: Unrecognized link type "' + linkType + '".');
               break;

+ 2 - 2
build/pdf.js

@@ -24,8 +24,8 @@
 }(this, function (exports) {
   // Use strict in our context only - users might not want it
   'use strict';
-  var pdfjsVersion = '1.6.311';
-  var pdfjsBuild = '2f5170f';
+  var pdfjsVersion = '1.6.313';
+  var pdfjsBuild = 'c23f124';
   var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null;
   var pdfjsLibs = {};
   (function pdfjsWrapper() {

+ 25 - 2
build/pdf.worker.js

@@ -24,8 +24,8 @@
 }(this, function (exports) {
   // Use strict in our context only - users might not want it
   'use strict';
-  var pdfjsVersion = '1.6.311';
-  var pdfjsBuild = '2f5170f';
+  var pdfjsVersion = '1.6.313';
+  var pdfjsBuild = 'c23f124';
   var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null;
   var pdfjsLibs = {};
   (function pdfjsWrapper() {
@@ -45954,6 +45954,29 @@
                 resultObj.action = namedAction.name;
               }
               break;
+            case 'JavaScript':
+              var jsAction = action.get('JS'), js;
+              if (isStream(jsAction)) {
+                js = bytesToString(jsAction.getBytes());
+              } else if (isString(jsAction)) {
+                js = jsAction;
+              }
+              if (js) {
+                // Attempt to recover valid URLs from 'JS' entries with certain
+                // white-listed formats, e.g.
+                //  - window.open('http://example.com')
+                //  - app.launchURL('http://example.com', true)
+                var URL_OPEN_METHODS = [
+                  'app.launchURL',
+                  'window.open'
+                ];
+                var regex = new RegExp('^(?:' + URL_OPEN_METHODS.join('|') + ')' + '\\((?:\'|\")(\\S+)(?:\'|\")(?:,|\\))');
+                var jsUrl = regex.exec(stringToPDFString(js), 'i');
+                if (jsUrl && jsUrl[1]) {
+                  url = jsUrl[1];
+                  break;
+                }
+              }
             default:
               warn('Catalog_parseDestDictionary: Unrecognized link type "' + linkType + '".');
               break;

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "pdfjs-dist",
-  "version": "1.6.311",
+  "version": "1.6.313",
   "main": "build/pdf.js",
   "description": "Generic build of Mozilla's PDF.js library.",
   "keywords": [