Commit Graph

16 Commits

Author SHA1 Message Date
Yury Delendik
5cff06e52a Refactors PDFHistory.
# Conflicts:
#	extensions/b2g/viewer.js
#	web/pdf_history.js
#	web/pdf_viewer.component.js
#	web/viewer.js
2015-05-16 11:20:36 -05:00
Jonas Jenwald
2dc1af8028 Break dependencies between PresentationMode and other code, and add PresentationMode related utility methods to PDFViewer
This patch:
 - Adds a couple of utility methods to `PDFViewer` to enable checking `presentationModeState` without cumbersome comparisons.

 - Disentangles `PresentationMode` from `PDFHistory` and `HandTool`, by adding event listeners for `presentationmodechanged` to both of them.

 - Adds a utility function to `PDFViewerApplication` for requesting PresentationMode.

 - Prevents initialization of `PresentationMode` if the browser does not support the fullscreen API.
2015-04-21 16:02:32 +02:00
Yury Delendik
44779f14b0 Renames and refactors PDFView to PDFViewerApplication. 2014-09-28 10:39:56 -05: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
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
44725d4657 [PDFHistory] Fix "Warning: Unhandled rejection: [Exception... "The operation is insecure."" in Firefox 25 2013-11-23 12:15:39 +01:00
Jonas Jenwald
ca8e3ea06f [PDFHistory] Fix "Warning: Unhandled rejection: [Exception... "The operation is insecure."" when opening local file 2013-11-22 11:49:16 +01:00
Brendan Dahl
2d489bab22 Merge pull request #3582 from Rob--W/pushState
Set URL in history.replaceState/pushState
2013-10-03 11:35:36 -07:00
Jonas Jenwald
bfc66626a0 Move Presentation Mode related code from viewer.js to its own file 2013-10-01 23:11:46 +02:00
Jonas Jenwald
fc73dbe695 [PDFHistory] Prevent the history from skipping entries in certain edge cases, when specifying an initialBookmark in the hash parameters on document load 2013-09-14 17:14:04 +02:00
Brendan Dahl
189d444ded Merge pull request #3507 from Snuffleupagus/PDFHistory-fix-multiple-identical-states
[PDFHistory] Prevent the history from getting stuck in certain edge cases
2013-09-04 12:09:41 -07:00
Rob Wu
c653bf3aff Set URL in history.replaceState/pushState
When <base href> is present, history.replaceState and
history.pushState behave inconsistent with relative URLs.
http://code.google.com/p/chromium/issues/detail?id=274024

Contrary to what one expect, passing '' as the URL parameter to
replaceState/pushState does not associate the currently active
URL with the history entry, but a path relative to <base href>.

To fix the issue, explicitly associate the current active URL
with the history's state.
2013-08-16 17:30:07 +02:00
Yury Delendik
fa885678df Don't provide optional pushState parameter 2013-08-16 09:09:32 -05:00
Jonas
869c4de289 [PDFHistory] Prevent the history from getting stuck in certain edge cases 2013-07-23 21:50:09 +02:00
Jonas
d99b7753d6 Check if viewer is embedded only once and cache the result 2013-07-20 16:33:40 +02:00
Jonas
09e0c9b65d Move PDFHistory from viewer.js to its own file 2013-07-18 17:18:27 +02:00