Commit Graph

6022 Commits

Author SHA1 Message Date
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
Jonas Jenwald
3c637b7ca9 Update the annotationLayer when using CSS only zoom 2014-01-12 23:07:56 +01:00
Jonas Jenwald
05c331c295 Maintain the current position in the document when zooming 2014-01-11 13:01:25 +01:00
Yury Delendik
a8c11ad1e5 Introduces disableObjectCreateURL 2014-01-10 16:30:41 -06:00
Tim van der Meij
d6ed4f2631 Merge pull request #4099 from yurydelendik/bug958050
Fixes FitV scrolling
2014-01-10 13:50:47 -08:00
Yury Delendik
2f4246abe4 Fixes FitV scrolling 2014-01-10 12:15:09 -06:00
Yury Delendik
95a7be0df4 Merge pull request #4080 from Snuffleupagus/bug-957034
Fix annotation border issue (bug 957034)
2014-01-09 05:55:53 -08:00
Jonas Jenwald
7c616502c2 Fix annotation border issue (bug 957034) 2014-01-09 13:44:21 +01:00
Tim van der Meij
1bc3c37972 Merge pull request #4097 from xavier114fch/zh-TW
Add form warning and minor translation update for zh-TW
2014-01-09 01:57:42 -08:00
Xavier fung
d87643e8c1 Add form warning and minor translation update for zh-TW 2014-01-09 11:16:13 +08:00
Tim van der Meij
cc22ebc94f Merge pull request #4095 from timvandermeij/form-dutch
Add forms warning to the Dutch l10n
2014-01-08 15:06:43 -08:00
Yury Delendik
20c4461113 Merge pull request #4094 from brendandahl/analyzer
Fix reftest analyzer naming(again).
2014-01-08 15:04:42 -08:00
Tim van der Meij
e6da6106b5 Add forms warning to the Dutch l10n 2014-01-09 00:01:49 +01:00
Tim van der Meij
ae117c296a Merge pull request #4088 from Rob--W/handtool-button-is-null
Allow hand tool toggle button to be optional
2014-01-08 14:41:20 -08:00
Yury Delendik
96eaa15578 Fixes fips regression from #4068 2014-01-08 16:33:22 -06:00
Brendan Dahl
edce4550db Fix reftest analyzer naming(again). 2014-01-08 14:02:07 -08:00
Brendan Dahl
508b00a34f Merge pull request #4071 from yurydelendik/bug921760
Adds glyph mapping for standard fonts
2014-01-08 12:36:54 -08:00
Yury Delendik
0131101275 Takes ascent/descent in account in the text layer 2014-01-08 13:50:52 -06:00
Brendan Dahl
bac4133f21 Merge pull request #4068 from yurydelendik/bug864847
Adjusts heuristic for disabling Symbol encoding
2014-01-08 10:48:18 -08:00
Brendan Dahl
ebdd710da3 Merge pull request #4034 from Snuffleupagus/setScale-regression
Fix setScale regression that affects exiting Presentation Mode on narrow window widths
2014-01-08 10:04:35 -08:00
Brendan Dahl
afc4144823 Merge pull request #4092 from Snuffleupagus/form-warning-msg
Add forms warning to the Swedish l10n
2014-01-08 09:58:34 -08:00
Jonas Jenwald
873c171e49 Add forms warning to the Swedish l10n 2014-01-08 18:47:31 +01:00
Yury Delendik
556820f22f Merge pull request #4077 from brendandahl/form-fallback
Show a different warning for PDF’s with forms.
2014-01-08 07:25:57 -08:00
Yury Delendik
ec01f6734f Merge pull request #4087 from brendandahl/analyzer
Label ref test analyzer images.
2014-01-08 07:24:03 -08:00
Rob Wu
838802c2d3 Explain meaning of elements in secondary_toolbar 2014-01-08 11:59:30 +01:00
Brendan Dahl
fd139324ef Label ref test analyzer images. 2014-01-07 16:11:29 -08:00
Brendan Dahl
5d080a03bb Show a different warning for PDF’s with forms. 2014-01-07 16:03:45 -08:00
Rob Wu
f2d13a2e2c Test if toggleHandTool is null before using it
Do not break the viewer if the buttons are not
available for some reason.
2014-01-07 22:55:38 +01:00
Yury Delendik
4d01ff4079 Merge pull request #4062 from kkujala/calgray
calgray: fix getRgbBuffer problem
2014-01-07 10:54:09 -08:00