diff --git a/browser/extensions/pdfjs/README.mozilla b/browser/extensions/pdfjs/README.mozilla index a267da12ece3..884f85eb38dc 100644 --- a/browser/extensions/pdfjs/README.mozilla +++ b/browser/extensions/pdfjs/README.mozilla @@ -1,3 +1,3 @@ This is the pdf.js project output, https://github.com/mozilla/pdf.js -Current extension version is: 1.6.304 +Current extension version is: 1.6.315 diff --git a/browser/extensions/pdfjs/content/build/pdf.js b/browser/extensions/pdfjs/content/build/pdf.js index 6a1368ca9ed4..98a3bd3923da 100644 --- a/browser/extensions/pdfjs/content/build/pdf.js +++ b/browser/extensions/pdfjs/content/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.304'; - var pdfjsBuild = 'b4100ba'; + var pdfjsVersion = '1.6.315'; + var pdfjsBuild = 'a139c75'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null; var pdfjsLibs = {}; (function pdfjsWrapper() { diff --git a/browser/extensions/pdfjs/content/build/pdf.worker.js b/browser/extensions/pdfjs/content/build/pdf.worker.js index 64f778f4f85d..4c35bd401c82 100644 --- a/browser/extensions/pdfjs/content/build/pdf.worker.js +++ b/browser/extensions/pdfjs/content/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.304'; - var pdfjsBuild = 'b4100ba'; + var pdfjsVersion = '1.6.315'; + var pdfjsBuild = 'a139c75'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null; var pdfjsLibs = {}; (function pdfjsWrapper() { @@ -45079,6 +45079,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/browser/extensions/pdfjs/content/web/viewer.css b/browser/extensions/pdfjs/content/web/viewer.css index ff75b04a87ff..74b6fab86a0c 100644 --- a/browser/extensions/pdfjs/content/web/viewer.css +++ b/browser/extensions/pdfjs/content/web/viewer.css @@ -326,32 +326,6 @@ select { cursor: default; } -/* outer/inner center provides horizontal center */ -.outerCenter { - pointer-events: none; - position: relative; -} -html[dir='ltr'] .outerCenter { - float: right; - right: 50%; -} -html[dir='rtl'] .outerCenter { - float: left; - left: 50%; -} -.innerCenter { - pointer-events: auto; - position: relative; -} -html[dir='ltr'] .innerCenter { - float: right; - right: -50%; -} -html[dir='rtl'] .innerCenter { - float: left; - left: -50%; -} - #outerContainer { width: 100%; height: 100%; @@ -665,24 +639,19 @@ html[dir='ltr'] .doorHangerRight:before { background-color: rgb(255, 102, 102); } -html[dir='ltr'] #toolbarViewerLeft { - margin-left: -1px; -} -html[dir='rtl'] #toolbarViewerRight { - margin-right: -1px; +#toolbarViewerMiddle { + position: absolute; + left: 50%; + transform: translateX(-50%); } html[dir='ltr'] #toolbarViewerLeft, html[dir='rtl'] #toolbarViewerRight { - position: absolute; - top: 0; - left: 0; + float: left; } html[dir='ltr'] #toolbarViewerRight, html[dir='rtl'] #toolbarViewerLeft { - position: absolute; - top: 0; - right: 0; + float: right; } html[dir='ltr'] #toolbarViewerLeft > *, html[dir='ltr'] #toolbarViewerMiddle > *, @@ -1958,38 +1927,47 @@ html[dir='rtl'] #documentPropertiesOverlay .row > * { display: none; } -@media all and (max-width: 960px) { - html[dir='ltr'] #outerContainer.sidebarMoving .outerCenter, - html[dir='ltr'] #outerContainer.sidebarOpen .outerCenter { - float: left; - left: 205px; - } - html[dir='rtl'] #outerContainer.sidebarMoving .outerCenter, - html[dir='rtl'] #outerContainer.sidebarOpen .outerCenter { - float: right; - right: 205px; +@media all and (max-width: 1040px) { + #outerContainer.sidebarMoving #toolbarViewerMiddle, + #outerContainer.sidebarOpen #toolbarViewerMiddle { + display: table; + margin: auto; + left: auto; + position: inherit; + transform: none; } } -@media all and (max-width: 900px) { +@media all and (max-width: 980px) { + .sidebarMoving .hiddenLargeView, .sidebarOpen .hiddenLargeView { display: none; } + .sidebarMoving .visibleLargeView, .sidebarOpen .visibleLargeView { display: inherit; } } -@media all and (max-width: 860px) { +@media all and (max-width: 900px) { + #toolbarViewerMiddle { + display: table; + margin: auto; + left: auto; + position: inherit; + transform: none; + } + .sidebarMoving .hiddenMediumView, .sidebarOpen .hiddenMediumView { display: none; } + .sidebarMoving .visibleMediumView, .sidebarOpen .visibleMediumView { display: inherit; } } -@media all and (max-width: 770px) { +@media all and (max-width: 840px) { #sidebarContainer { top: 32px; z-index: 100; @@ -2009,15 +1987,6 @@ html[dir='rtl'] #documentPropertiesOverlay .row > * { right: 0px; } - html[dir='ltr'] .outerCenter { - float: left; - left: 205px; - } - html[dir='rtl'] .outerCenter { - float: right; - right: 205px; - } - #outerContainer .hiddenLargeView, #outerContainer .hiddenMediumView { display: inherit; @@ -2028,7 +1997,7 @@ html[dir='rtl'] #documentPropertiesOverlay .row > * { } } -@media all and (max-width: 700px) { +@media all and (max-width: 770px) { #outerContainer .hiddenLargeView { display: none; } @@ -2037,7 +2006,7 @@ html[dir='rtl'] #documentPropertiesOverlay .row > * { } } -@media all and (max-width: 660px) { +@media all and (max-width: 700px) { #outerContainer .hiddenMediumView { display: none; } @@ -2046,29 +2015,19 @@ html[dir='rtl'] #documentPropertiesOverlay .row > * { } } -@media all and (max-width: 600px) { +@media all and (max-width: 640px) { .hiddenSmallView { display: none; } .visibleSmallView { display: inherit; } - html[dir='ltr'] #outerContainer.sidebarMoving .outerCenter, - html[dir='ltr'] #outerContainer.sidebarOpen .outerCenter, - html[dir='ltr'] .outerCenter { - left: 156px; - } - html[dir='rtl'] #outerContainer.sidebarMoving .outerCenter, - html[dir='rtl'] #outerContainer.sidebarOpen .outerCenter, - html[dir='rtl'] .outerCenter { - right: 156px; - } .toolbarButtonSpacer { width: 0; } } -@media all and (max-width: 510px) { +@media all and (max-width: 535px) { #scaleSelectContainer { display: none; } diff --git a/browser/extensions/pdfjs/content/web/viewer.html b/browser/extensions/pdfjs/content/web/viewer.html index 2de31118e6f0..3a06aa7b1610 100644 --- a/browser/extensions/pdfjs/content/web/viewer.html +++ b/browser/extensions/pdfjs/content/web/viewer.html @@ -194,35 +194,33 @@ See https://github.com/adobe-type-tools/cmap-resources Tools -
-
-
- -
- -
- - - +
+
+ +
+
+ + +