Commit Graph

718 Commits

Author SHA1 Message Date
Jonas Jenwald
4ee1fb7956 Fix spacebar scrolling in Firefox (4224 follow-up) 2014-02-26 20:17:58 +01:00
Brendan Dahl
0af0c6c99d Merge pull request #4229 from Rob--W/crx-stream-progress
Get progress bar for PDF streams in Chromium by passing the expected content length to the page
2014-02-26 11:12:34 -08:00
Brendan Dahl
890752680b Merge pull request #4224 from Rob--W/shortcut-responsiveness
Focus container when arrow/navigation keys are pressed
2014-02-26 10:52:17 -08:00
Yury Delendik
4563f6cd58 Merge pull request #4191 from Rob--W/crx-chrome-os
Register PDF Viewer as PDF handler in Chrome OS's file browser
2014-02-11 12:51:36 -06:00
Brendan Dahl
e477958b74 Remove inline script warnings. 2014-02-03 14:14:54 -08:00
Rob Wu
ce9400dc8b Handle navigation keys when viewer is not focused
Restrict the scrollbar hack to the keycode for "spacebar",
since the bug only occurs in Firefox with spacebar.

Keyboard navigation is only activated for the spacebar if
the currently focused element is not a button.
2014-01-31 14:59:49 +01:00
Rob Wu
eaf7daf7db [CRX] Pass expected length of stream to viewer
To get a progress bar for POST/FTP requests in Chromium.
2014-01-30 23:03:15 +01:00
Rob Wu
64a4a27455 Remove obsolete code from shortcut handler
These lines were introduced in 612f59aa10
when the only shortcuts were +/-/=/0 (to change zoom level).
Back then, when the input fields were focused, using these keys would
add these unwanted characters to the input field and change the zoom
level of the viewer. Having both operations at the same time was an
undesired event, so a check was inserted, to ignore shortcuts when
the toolbar is focused.

The #toolbar element doesn't exist any more, so these lines are obsolete.
2014-01-30 15:26:51 +01:00
Brendan Dahl
c2e31cd1ef Merge pull request #4205 from yurydelendik/blob-open-file
Using blob URL for open file
2014-01-28 14:15:35 -08:00
Brendan Dahl
0e000392ae Merge pull request #4179 from yurydelendik/dataLoaded
Fixes PDFDocumentProxy.getDataLoaded API name (and refactoring)
2014-01-28 13:56:01 -08:00
Yury Delendik
e5e9c6e243 Fixes PDFDocumentProxy.getDownloadInfo API name (and refactoring) 2014-01-28 15:13:47 -06:00
Tim van der Meij
b4b145507c Implements mouse wheel behaviour for non-Firefox browsers 2014-01-28 20:52:25 +01:00
Yury Delendik
18515b8668 Using blob URL for open file 2014-01-27 13:11:02 -06:00
Rob Wu
7bbff32a4d [security] Verify message source in Firefox add-on
And put initPassiveLoading within a preprocessor block because
it is only used by Firefox.
2014-01-26 12:55:48 +01:00
Rob Wu
60fb28caf0 Register as File browser handler in Chrome OS 2014-01-25 22:37:19 +01:00
Rob Wu
b0e18a0703 [CRX] Remove redundant location.origin check
The PDF Viewer will always be rendered directly from the extension,
so checking "origin == chrome-extension:/.." is not needed any more.
( since edd4bae903 )
2014-01-25 21:44:58 +01:00
Rob Wu
aeaf11ca43 [CRX] Fall back to sender.tab.url if !tab.url
sender.url is relatively new (Chromium 29)
 ( https://chromiumcodereview.appspot.com/14301016 )
2014-01-25 20:15:43 +01:00
Yury Delendik
ba1eb4d1d1 Merge pull request #4126 from Rob--W/crx-using-streams-api
Chromium extension using streamsPrivate API!
2014-01-22 05:12:07 -08:00
Tim van der Meij
5f7ded4ff6 Document properties 2014-01-22 00:07:07 +01:00
Brendan Dahl
e13500e46b Merge pull request #4140 from timvandermeij/close-secondary-toolbar
Close the secondary toolbar when an action is performed once
2014-01-21 11:47:11 -08:00
Sriram
151cd6dee8 Terminate worker of previous doc 2014-01-21 07:13:27 +05:30
Tim van der Meij
e14d917161 Close the secondary toolbar when an action is only performed once 2014-01-17 12:16:43 +01: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
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
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
Tim van der Meij
e05bda4045 De-inline CSS for the 'open file' button 2014-01-13 22:04:36 +01:00
Jonas Jenwald
05c331c295 Maintain the current position in the document when zooming 2014-01-11 13:01:25 +01: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
5d080a03bb Show a different warning for PDF’s with forms. 2014-01-07 16:03:45 -08:00
Yury Delendik
5bf3e44e30 Introduces LegacyPromise; polyfills DOM Promise 2014-01-03 18:17:05 -06:00
Brendan Dahl
2228343f77 Only trigger warning bar on certain unsupported features. 2014-01-03 09:34:13 -08:00
Yury Delendik
c389451a5b Merge pull request #4045 from brendandahl/verbosity
Add verbosity as an api setting.
2014-01-02 12:25:00 -08:00
Brendan Dahl
d005353115 Merge pull request #4055 from Snuffleupagus/fix-thumbnail-rotation-regression
Fix thumbnail rotation regression
2014-01-02 10:39:13 -08:00
Jonas Jenwald
3d523000b9 Fix thumbnail rotation regression 2013-12-25 23:10:17 +01:00
Jonas Jenwald
4bd9767112 Rename 'Settings' to 'ViewHistory' 2013-12-22 00:07:42 +01:00
Jonas Jenwald
31ec36d64f Fix typo in 'isViewFinished' function name 2013-12-20 15:32:16 +01:00
Brendan Dahl
53549411b4 Add verbosity as an api setting. 2013-12-18 13:39:03 -08:00
Jonas Jenwald
e4f799a09c Small cleanup in 'set page' 2013-12-18 03:08:50 +01:00
Rob Wu
8526d3c600 [CRX] Add a pageAction to omnibox showing PDF URL
In Chromium extensions, the viewer's URL looks like this:
chrome-extension://oemmndcbldboiebfnladdacbdfmadadm/http://example.com/file.pdf

Furthermore, the PDF Viewer itself can also add something to the reference fragment:
chrome-extension://oemmndcbldboiebfnladdacbdfmadadm/http://example.com/file.pdf#page=2

Consequently, it is difficult to copy a clean URL (e.g. for sharing over mail)
without having to tidy-up the URL manually.

This commit solves this issue by adding a button to the omnibox,
which shows the clean PDF URL on click.
2013-12-16 19:00:32 +01:00
Jonas Jenwald
694b3d55b1 Fix setScale regression that affects exiting Presentation Mode on narrow window widths 2013-12-14 23:09:36 +01:00
Rob Wu
3914768085 Implement hand tool
The logic for the hand tool is implemented in a separate project,
maintained at https://github.com/Rob--W/grab-to-pan.js

Integration notes
- Added toggle as an entry under the Secondary toolbar
- Added shortcut "h" to toggle hand tool (to-do: document this in wiki
  after merge). This shortcut is also used in Adobe's Acrobat Reader.

To-do: localizations for:
hand_tool_enable.title=
hand_tool_enable_label=
hand_tool_disable.title=
hand_tool_disable_label=

To-do (wish): persistence of hand tool preference, preferably a global setting.

secondaryToolbarButton-handTool.png created by Stephen Horlander <shorlander@mozilla.com>
2013-12-03 15:51:41 +01:00
Brendan Dahl
d0312aa6ba Wait for one page to render before fetching all pages. 2013-11-26 13:55:50 -08:00
Brendan Dahl
c9f2390567 Fix printing regression from #3848. 2013-11-25 16:13:40 -08:00
Jonas Jenwald
7542d50167 Fix issues with /FitR destinations 2013-11-23 18:27:03 +01:00
Yury Delendik
78b61fedfc Merge branch 'maxsong1002/shortcutkeytonavigate' 2013-11-22 08:22:12 -06:00
maxsong1002
807e4fef34 Add shortcut for goto page 2013-11-22 08:20:05 -06:00
Yury Delendik
124eb30e8d Merge pull request #3936 from brendandahl/initial-data
Leave initial request open until the viewer is ready to switch to range requests.
2013-11-21 06:22:24 -08:00
Yury Delendik
bd7985a83b Fixes cleaning up of the rendered pages 2013-11-19 17:08:36 -06:00
Jonas Jenwald
60610cd625 Implement default preferences 2013-11-18 23:51:06 +01:00
Brendan Dahl
3132c9e7e9 Merge pull request #3911 from yurydelendik/mem-redux2
Cleaning up fonts when viewer is idle for some time
2013-11-18 13:01:23 -08:00