Commit Graph

6050 Commits

Author SHA1 Message Date
Sriram
151cd6dee8 Terminate worker of previous doc 2014-01-21 07:13:27 +05:30
Jonas Jenwald
575bdd8863 Fix loading of fonts with invalid encoding name entry (bug 859204 and 878112) 2014-01-21 02:03:28 +01:00
Nicholas Nethercote
0685214a77 Don't create the RGB buffer for images that don't need resizing. 2014-01-19 14:21:36 -08:00
Yury Delendik
96fff4cc74 Refactors getTextContent return value 2014-01-17 13:26:00 -06:00
Brendan Dahl
ac91047f6d Merge pull request #4072 from yurydelendik/check-aa
Checks if subpixel-aa enabled before scaling the fonts
2014-01-17 10:45:17 -08:00
Yury Delendik
11e0ab3530 Merge pull request #4135 from timvandermeij/cleanup-extension
Cleaning up files in extension
2014-01-17 09:40:18 -08:00
Tim van der Meij
2684c79c4d Cleaning up files in extension 2014-01-17 18:32:30 +01:00
Yury Delendik
9409f3794a Merge pull request #4136 from timvandermeij/remove-extension-files
Removing extension-files file
2014-01-17 09:03:30 -08:00
Yury Delendik
e7d16ba1a2 Merge pull request #4138 from nnethercote/chunk-ImageData
Do createImageData/putImageData in chunks, to save memory.
2014-01-17 08:55:24 -08:00
Tim van der Meij
45585d9dd5 Merge pull request #4142 from Snuffleupagus/css-cleanup
Remove old CSS rules
2014-01-17 07:49:26 -08:00
Jonas Jenwald
80f5ae518f Remove old CSS rules 2014-01-17 16:31:51 +01:00
Tim van der Meij
070d77a332 Merge pull request #4119 from yurydelendik/preprocessor
Extracts evaluator preprocessor, refactor text extraction and paintFormXObject
2014-01-17 06:21:00 -08:00
Yury Delendik
09f8f951c8 Extracts evaluator preprocessor and refactor text extraction 2014-01-17 07:16:52 -06:00
Tim van der Meij
e14d917161 Close the secondary toolbar when an action is only performed once 2014-01-17 12:16:43 +01:00
Nicholas Nethercote
c044652320 Remove unneeded srcOffset arguments from createRgbBuffer. 2014-01-16 20:15:37 -08:00
Nicholas Nethercote
3de5d6ad0c Don't create the opacity buffer for images that lack a mask. 2014-01-16 20:15:37 -08:00
Nicholas Nethercote
4332c2fabe Do createImageData/putImageData in chunks, to save memory. 2014-01-16 17:20:20 -08:00
Tim van der Meij
c6640809a4 Removing extension-files file 2014-01-17 00:10:39 +01:00
Karl Denninghoff
1be27e3c81 Fixes but 960409 and adresses review comments including removal of do-while construct 2014-01-16 13:58:29 -08:00
Brendan Dahl
455265474a Merge pull request #4093 from yurydelendik/issue4068
Fixes fips regression from #4068
2014-01-16 13:45:10 -08:00
Brendan Dahl
ff66c23e6e Merge pull request #4089 from yurydelendik/issue3725
Takes ascent/descent in account in the text layer
2014-01-16 13:12:04 -08:00
Brendan Dahl
c57fdcceed Merge pull request #4125 from yurydelendik/issue4111
Fixes and refactors log functionality
2014-01-16 10:54:09 -08:00
Brendan Dahl
3b829f4a45 Merge pull request #4103 from yurydelendik/issue3977
Introduces disableObjectCreateURL
2014-01-16 10:51:22 -08:00
Yury Delendik
6c3bdd144a Merge pull request #4128 from Snuffleupagus/fix-open-button-on-fallback-bar
Fix regression that disabled the "Open With Different Viewer" button on the fallback bar
2014-01-16 05:26:30 -08:00
Jonas Jenwald
181e06f30a Fix regression that disabled the "Open With Different Viewer" button on the fallback bar 2014-01-16 13:49:39 +01:00
Rob Wu
b754f9d878 Make streamsPrivate optional; remove manifest key
Use streamsPrivate API when available.
When the API is not available, the extension will still work on
on http/https/file URLs, but not for POST requests or FTP.

As of writing, the Chromium project has still not whitelisted
the PDF Viewer extension in the Chrome Web Store.
 (extension ID oemmndcbldboiebfnladdacbdfmadadm)
Request to whitelist PDF.js in Chromium:
 https://code.google.com/p/chromium/issues/detail?id=326949

Opera 19 has whitelisted the PDF Viewer extension from
 https://addons.opera.com/extensions/details/pdf-viewer/
 (extension ID encfpfilknmenlmjemepncnlbbjlabkc)
 (https://github.com/Rob--W/pdf.js/issues/1#issuecomment-32357302)

If you want to test the streamsPrivate feature in Chrome,
edit the build/extensions/manifest.json and add the "key" again
 (see this commit for the value of this "key" field).
2014-01-16 00:30:39 +01:00
Rob Wu
af31ace940 Work-around for http://crbug.com/276898
When a new incognito session is started, the onExecuteMimeTypeHandler event is
often not dispatched in time. Instead, it's triggered in the non-incognito profile.

This commit offers a work-around that allows new incognito instances to view PDF files.
2014-01-15 23:04:29 +01:00
Rob Wu
94ba01c8aa Use tab-specific stream storage
Also:
- Use webNavigation.getAllFrames to find out whether the navigation has
  already started. This is (at least) needed for top-level navigation to
  a stream. The webNavigation.onErrorOccurred event has become obsolete,
  and has been removed.
2014-01-15 23:04:29 +01:00
Rob Wu
32313b9149 Insert dummy content script at every location.
This is needed for propagating the extension's permissions
to the extension's iframe, in the rare event that the PDF is
loaded in a sub frame, and the extension does not have access to the
top frame. For instance, when a http:-PDF file is embedded in a
local file, while "Allow access to local URLs" is disabled.

Note: Propagating permissions by inserting content scripts is an
 undocumented feature (http://crbug.com/302548).

Whenever it breaks, the issue (cross-domain permissions for XHR)
can be solved by using a content script that gets the blob using
the XMLHttpRequest API, followed by `postMessage` (via transferables)
to efficiently pass the arraybuffer back to the PDF Viewer.
2014-01-15 23:04:29 +01:00
Rob Wu
cdadb0db4d Proof of concept using chrome.streamsPrivate API
This method captures all application/pdf streams, loads the viewer
and passes the stream to the PDF.js viewer.

This commit shows a proof of concept using the chrome.streamsPrivate API.

Advantages of new method:
- Access to the response body of the original request, thus fewer
  network requests.
- PDFs from non-GET requests (e.g. POST) are now supported.
- FTP files are also supported.

Possible improvements:
- Use declared content scripts instead of dynamic chrome.tabs.executeScript.
  This allows the extension to render the viewer in frames when the
  extension is disallowed to run executeScript for the top URL.
- Use chrome.declarativeWebRequest instead of webRequest, and replace
  background page with event page (don't forget to profile the
  difference & will the background/event page still work as intended?).
2014-01-15 23:04:15 +01:00
Yury Delendik
754e000907 Fixes and refactors log functionality 2014-01-15 15:28:31 -06:00
Yury Delendik
ab4f27b272 Merge pull request #4124 from tkristiansen/with-credentials
Allow setting xhr.withCredentials
2014-01-15 11:42:41 -08:00
terje.kristiansen
08737375f8 Added withCredentials parameter and passing it to xhr requests 2014-01-15 10:12:40 +01:00
Yury Delendik
7e75a665d2 Checks if subpixel-aa enabled before scaling the fonts 2014-01-14 17:31:23 -06:00
Brendan Dahl
a340336269 Merge pull request #4081 from yurydelendik/doubledraw
Avoiding double draw() calls
2014-01-14 14:33:16 -08:00
Yury Delendik
71cc234c6a Merge pull request #4122 from yurydelendik/bug878397
Use a more compact typed array to pass the image mask from the worker
2014-01-14 11:15:44 -08:00
Yury Delendik
1991efe4f0 Fixes type3 glyph compilation for bitpacked mask 2014-01-13 21:21:03 -06:00
Nicholas Nethercote
3f533a1cb0 Use a more compact typed array to pass the image mask from the worker to the main thread. 2014-01-13 20:09:05 -06:00
Yury Delendik
dabafb8444 Merge pull request #4121 from timvandermeij/open-button-b2g
Prevent the open file button from appearing in the B2G viewer/preview
2014-01-13 15:23:13 -08:00
Tim van der Meij
3e8795f8b8 Prevent the open file button from appearing in the B2G viewer/preview 2014-01-14 00:09:54 +01:00
Yury Delendik
2beb446f9d Merge pull request #4120 from timvandermeij/css-deinlining
De-inline CSS for the 'open file' button
2014-01-13 14:52:37 -08:00
Tim van der Meij
e05bda4045 De-inline CSS for the 'open file' button 2014-01-13 22:04:36 +01:00
Yury Delendik
f7a34df46d Merge pull request #4114 from Rob--W/crx-executeScriptInFrame-fix
Update chrome.tabs.executeScriptInFrame dependency
2014-01-13 12:45:50 -08:00
Yury Delendik
909fd5bd69 Merge pull request #4117 from timvandermeij/presentation-mode-background
Make presentation mode use a black background
2014-01-13 12:41:06 -08:00
Tim van der Meij
08e1ef356a Make presentation mode use a black background 2014-01-13 21:30:47 +01:00
Rob Wu
18e4d32c11 Update chrome.tabs.executeScriptInFrame dependency
References:
- https://github.com/Rob--W/chrome-api/issues/1
- 4c5a598c0b...f211d2d679
2014-01-13 21:21:02 +01:00
Tim van der Meij
110ca0d999 Merge pull request #4116 from Snuffleupagus/move-Swedish-l10n
Move the Swedish l10n
2014-01-13 12:20:53 -08:00
Tim van der Meij
ee48522a86 Merge pull request #4109 from Snuffleupagus/css-zoom-annotations
Update the annotationLayer when using CSS only zoom
2014-01-13 12:14:12 -08:00
Brendan Dahl
6c1021fec0 Merge pull request #4074 from Snuffleupagus/maintain-position-on-zoom
Maintain the current position in the document when zooming
2014-01-13 10:14:34 -08:00
Jonas Jenwald
1bba4d6da3 Move the Swedish l10n 2014-01-13 18:42:48 +01:00