Closed Bug 784718 Opened 12 years ago Closed 12 years ago

Update pdf.js for FF17

Categories

(Firefox :: PDF Viewer, task)

x86
macOS
task
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 17

People

(Reporter: bdahl, Assigned: bdahl)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

      No description provided.
Release Notes
#1899 Catch errors when parsing the linearization header.
#1901 Sync up a few files with mozcentral.  Address mozcentral review comments.
#1903 Also check abbreviation for colorspace in jpegs.
#1839 Speedup textLayer creation
#1915 Don't trigger TODO on marked content.
#1910 Support more type 1 font hsbw formats.
#1909 Prevent the error callback from being called twice when getPdf fails because of a cross domain request.
#1892 Add support for type 1 seac charstring command.
#1840 Moves loading of the binary PDF data to the worker
#1926 Allow relative URLs in getDocument
#1919 Updated Japanese locale
#1939 Update danish locale
#1938 Presentation Mode - Replaces #1388
#1952 Fixes Shading.Dummy return type
#1942 Workaround Opera background style in <select> element.
#1908 Fix initial scroll direction detection.
#1947 Fix loading of the font widths
#1956 Clean up the test manifest file.
#1958 Update Spanish l10n
#1961 Use timeout for font ready callback to avoid intermittent chrome failure
#1957 Sanitize the document info.
#1964 Improved page tracking on scrolling [squashed]
#1965 Added .DS_Store reference in gitignore file
#1953 Add B2G build and new preprocessor.
#1963 Fix some minor issues/nits detected by JetBrains' WebStorm inspector.
#1962 Adds overrideMimeType for IE10 and discontinues readAsBinaryString use
#1967 Cleanup references to dom elements.
#1974 Changing cubic spline interpolation error to TODO
#1972 Finds correct window/notification box for fallback message
#1971 Using fast pixels copy in putBinaryImageData
#1981 Update Japanese l10n
#1976 Marks xref entries with offset 0 as free
#1977 Adds callothersubr support
#1978 Fixes bias calculation for type2 subr
#1975 Simulate support of data URIs for IE10
#1979 Discards invalid values for Blues
#1992 Stop streams from being sent from worker for indexed color spaces.
#2002 Adds textlayer debug modes
#2001 Adds stub of the PdfJs.jsm
#2005 Removes horizontal lines in scanned images
#1943 Implements loading PDF data by extension/chrome
#1999 Add carriage return checks to make.js.
#2009 Correct gjslint warnings in builder.js.
#2010 [cherry-pick #1997] Update src/fonts.js
#2012 Bump version to 0.4

Try Run:
https://tbpl.mozilla.org/?tree=Try&rev=7eef1b5bc211
Attached patch pdf.js 0.4.3 (obsolete) — Splinter Review
As usual most of the changes are in content only code, but there has been a change to pdfstreamconverter.js.  We now load the pdf in chrome code and send it to the content code (see https://github.com/mozilla/pdf.js/pull/1943).
Attachment #654256 - Flags: review?(dtownsend+bugmail)
Attached patch pdf.js 0.4.11Splinter Review
Small fix for when servers report a bad length or offset.
Attachment #654256 - Attachment is obsolete: true
Attachment #654256 - Flags: review?(dtownsend+bugmail)
Attachment #654822 - Flags: review?(dtownsend+bugmail)
Comment on attachment 654822 [details] [diff] [review]
pdf.js 0.4.11

Review of attachment 654822 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/extensions/pdfjs/components/PdfStreamConverter.js
@@ +327,5 @@
> +    }
> +    if (!notificationBox) {
> +      log('Unable to get a notification box for the fallback message');
> +      return;
> +    }

This is ok for now but I don't think you need the loop here, you can just directly get the main window for the child document using something like this https://developer.mozilla.org/en-US/docs/Working_with_windows_in_chrome_code#Accessing_the_elements_of_the_top-level_document_from_a_child_window

I think there may also be a frameElement property on one of those interfaces that gives you the browser element for the child window too.
Attachment #654822 - Flags: review?(dtownsend+bugmail) → review+
Thanks, for the review.  I opened an issue on github for the feedback and we'll update in the next version. https://github.com/mozilla/pdf.js/issues/2027
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/11a5ebc0e43a
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Blocks: 782217
Blocks: 776026
     // Keep the URL the same so the browser sees it as the same.
     channel.originalURI = aRequest.URI;
     channel.asyncOpen(proxy, aContext);
+    if (useFetchByChrome) {
+      // We can use resource principal when data is fetched by the chrome
+      // e.g. useful for NoScript
+      var securityManager = Cc['@mozilla.org/scriptsecuritymanager;1']
+                            .getService(Ci.nsIScriptSecurityManager);
+      var uri = ioService.newURI(PDF_VIEWER_WEB_PAGE, null, null);
+      // FF16 and below had getCodebasePrincipal (bug 774585)
+      var resourcePrincipal = 'getSimpleCodebasePrincipal' in securityManager ?
+                              securityManager.getSimpleCodebasePrincipal(uri) :
+                              securityManager.getCodebasePrincipal(uri);
+      channel.owner = resourcePrincipal;
+    }
   },


I'm going to replace getSimpleCodebasePrincipal() with getNoAppCodebasePrincipal() to fix a crash. See bug 773373
(In reply to Jan Varga [:janv] from comment #8)
> I'm going to replace getSimpleCodebasePrincipal() with
> getNoAppCodebasePrincipal() to fix a crash. See bug 773373

You would need to remove "FF16 and below" comment and logic as well:

  var resourcePrincipal = securityManager.getNoAppCodebasePrincipal(uri);

The issue https://github.com/mozilla/pdf.js/issues/2134 opened to add fallback logic for the pdf.js addon
Type: defect → task
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: