From b8f6fc2dbe277c9031d3c60cb2ac288187d0034b Mon Sep 17 00:00:00 2001 From: Pdf Bot Date: Wed, 9 Nov 2016 09:34:20 +0000 Subject: [PATCH] PDF.js version 1.6.313 - See mozilla/pdf.js@c23f124051b5e1a81a411c9e890a4efd5c237cf2 --- bower.json | 2 +- build/pdf.combined.js | 27 +++++++++++++++++++++++++-- build/pdf.js | 4 ++-- build/pdf.worker.js | 27 +++++++++++++++++++++++++-- package.json | 2 +- 5 files changed, 54 insertions(+), 8 deletions(-) diff --git a/bower.json b/bower.json index 54c274ed9..a5b0409ef 100644 --- a/bower.json +++ b/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" diff --git a/build/pdf.combined.js b/build/pdf.combined.js index 2083d257d..47fd893cf 100644 --- a/build/pdf.combined.js +++ b/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; diff --git a/build/pdf.js b/build/pdf.js index f603799a7..b89ffb2b2 100644 --- a/build/pdf.js +++ b/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() { diff --git a/build/pdf.worker.js b/build/pdf.worker.js index 5593d19c3..bcf89aa11 100644 --- a/build/pdf.worker.js +++ b/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; diff --git a/package.json b/package.json index 9eff66593..bbac37ad4 100644 --- a/package.json +++ b/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": [