pdf.js/web
Jonas Jenwald 0d58bb5512 Temporarily add the current position to the browser history when the viewer is idle
This patch attempts to address an issue in the old `PDFHistory` implementation, where the current position wouldn't be correctly saved when the browser was closed.
In theory this *should* already be working, however as the discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1153393 showed, it seems that both `pagehide` and `beforeunload` arrive to late to successfully update the history during closing.

Hence a timeout is used to *temporarily* add the current position to the browser history when the viewer is idle.
Note that we need to take care not to update the browser history too often, since that would render the viewer more or unusable. Furthermore, if the timeout is *too* long it may end up effectively disable this whole functionality.

The `UPDATE_VIEWAREA_TIMEOUT` constant is thus a heuristic value, which we may need to tweak taking the above into account.
2017-08-30 19:45:13 +02:00
..
images Add icons for the new "Select tool" button 2017-05-22 00:51:03 +02:00
.gitignore Remove obselete file from .gitignore 2015-01-26 16:44:45 +01:00
annotation_layer_builder.css Annotations: implement support for line annotations 2017-04-12 23:05:25 +02:00
annotation_layer_builder.js Change var to let, and use object destructuring, in a couple of previously class converted web/*.js files 2017-07-03 11:22:49 +02:00
app.js Re-write PDFHistory from scratch 2017-08-30 19:45:13 +02:00
chrome-i18n-allow-access-to-file-urls.json Add translations of "Allow access to file URLs" 2015-08-14 18:59:55 +02:00
chromecom.js [CRX] Integrate cursorToolOnLoad pref + migration logic 2017-07-15 01:50:15 +02:00
compatibility.js Move compatibility code to the shared/compatibility.js. 2017-02-23 19:18:44 -06:00
compressed.tracemonkey-pldi-09.pdf Add Makefile. Move some files around to make building the website easier. 2011-07-05 10:53:57 -07:00
debugger.js Fix inconsistent spacing and trailing commas in objects in web/ files, so we can enable the comma-dangle and object-curly-spacing ESLint rules later on 2017-06-01 12:47:47 +02:00
default_preferences.json Add support for, the API property, PageMode in the viewer (issue 8657) 2017-07-19 16:58:25 +02:00
dom_events.js ES6-ify the code in web/dom_events.js 2017-07-29 13:17:22 +02:00
download_manager.js Convert DownloadManager to an ES6 class 2017-08-06 14:15:18 +02:00
firefox_print_service.js Fix inconsistent spacing and trailing commas in objects in web/ files, so we can enable the comma-dangle and object-curly-spacing ESLint rules later on 2017-06-01 12:47:47 +02:00
firefoxcom.js Fix inconsistent spacing and trailing commas in objects in web/ files, so we can enable the comma-dangle and object-curly-spacing ESLint rules later on 2017-06-01 12:47:47 +02:00
genericcom.js Wraps mozL10n to async calls; splits firefox and generic l10n libs. 2017-05-31 09:22:25 -05:00
genericl10n.js Wraps mozL10n to async calls; splits firefox and generic l10n libs. 2017-05-31 09:22:25 -05:00
grab_to_pan.js Fix inconsistent spacing and trailing commas in objects in web/ files, so we can enable the comma-dangle and object-curly-spacing ESLint rules later on 2017-06-01 12:47:47 +02:00
interfaces.js Re-write PDFHistory from scratch 2017-08-30 19:45:13 +02:00
overlay_manager.js Convert the overlay manager to ES6 syntax 2017-05-28 21:18:18 +02:00
password_prompt.js Change var to let, and use object destructuring, in a couple of previously class converted web/*.js files 2017-07-03 11:22:49 +02:00
pdf_attachment_viewer.js Attempt to delay disabling of the attachment view until FileAttachment annotations of the *initial* page has been parsed 2017-08-17 14:30:03 +02:00
pdf_cursor_tools.js Unify handling of various cursor tools, e.g. the current Hand Tool and a possible future Zoom Tool, in a new PDFCursorTools module 2017-05-22 00:51:01 +02:00
pdf_document_properties.js Change var to let, and use object destructuring, in a couple of previously class converted web/*.js files 2017-07-03 11:22:49 +02:00
pdf_find_bar.js Ensure that PDFFindBar._adjustWidth is called in all situations where the width of the findbar might have changed 2017-07-05 11:34:14 +02:00
pdf_find_controller.js More robust getPage() error handling. 2017-08-04 17:03:33 -05:00
pdf_history.js Temporarily add the current position to the browser history when the viewer is idle 2017-08-30 19:45:13 +02:00
pdf_link_service.js Re-write PDFHistory from scratch 2017-08-30 19:45:13 +02:00
pdf_outline_viewer.js Call the reset() methods in the PDFAttachmentViewer and PDFOutlineViewer constructors 2017-08-17 13:04:24 +02:00
pdf_page_view.js More robust getPage() error handling. 2017-08-04 17:03:33 -05:00
pdf_presentation_mode.js Change var to let, and use object destructuring, in a couple of previously class converted web/*.js files 2017-07-03 11:22:49 +02:00
pdf_print_service.js Fix inconsistent spacing and trailing commas in objects in web/ files, so we can enable the comma-dangle and object-curly-spacing ESLint rules later on 2017-06-01 12:47:47 +02:00
pdf_rendering_queue.js Convert the rendering queue to ES6 syntax 2017-04-27 16:23:30 +02:00
pdf_sidebar.js Remove the ability to pass a scale parameter in the (optional) args object parameter of PDFViewerApplication.open(file, args) 2017-08-24 13:14:00 +02:00
pdf_thumbnail_view.js Convert the thumbnail view to ES6 syntax 2017-06-04 21:32:27 +02:00
pdf_thumbnail_viewer.js More robust getPage() error handling. 2017-08-04 17:03:33 -05:00
pdf_viewer.component.js Wraps mozL10n to async calls; splits firefox and generic l10n libs. 2017-05-31 09:22:25 -05:00
pdf_viewer.css Ensure canvas is really hidden when used with pdfjs-dist. 2017-06-20 14:45:07 -05:00
pdf_viewer.js Remove handling of fallback arguments from PDFViewer.scrollPageIntoView 2017-08-22 12:08:34 +02:00
pdfjs.js Fixes pdf.js library source detection. 2017-07-13 14:57:39 -05:00
preferences.js Fix inconsistent spacing and trailing commas in objects in web/ files, so we can enable the comma-dangle and object-curly-spacing ESLint rules later on 2017-06-01 12:47:47 +02:00
secondary_toolbar.js Fix inconsistent spacing and trailing commas in objects in web/ files, so we can enable the comma-dangle and object-curly-spacing ESLint rules later on 2017-06-01 12:47:47 +02:00
text_layer_builder.css Use default line height for the text layer 2015-12-02 23:00:12 +01:00
text_layer_builder.js Convert the text layer builder to ES6 syntax 2017-06-29 23:41:25 +02:00
toolbar.js Remove the selectScaleOption helper function, in Toolbar._updateUIState, and simply inline its code instead 2017-06-26 13:06:24 +02:00
ui_utils.js Add a waitOnEventOrTimeout helper function that allows waiting for an event or a timeout, whichever occurs first 2017-08-30 19:45:13 +02:00
view_history.js Remove the migration code for old localStorage data in ViewHistory 2017-08-19 11:41:04 +02:00
viewer-snippet-chrome-extension.html Wraps mozL10n to async calls; splits firefox and generic l10n libs. 2017-05-31 09:22:25 -05:00
viewer-snippet-chrome-overlays.html Add translations of "Allow access to file URLs" 2015-08-14 18:59:55 +02:00
viewer-snippet-firefox-extension.html Wraps mozL10n to async calls; splits firefox and generic l10n libs. 2017-05-31 09:22:25 -05:00
viewer-snippet-minified.html Remove XHTML leftovers from the viewer HTML files 2016-02-14 13:23:34 +01:00
viewer-snippet.html Wraps mozL10n to async calls; splits firefox and generic l10n libs. 2017-05-31 09:22:25 -05:00
viewer.css Unify handling of various cursor tools, e.g. the current Hand Tool and a possible future Zoom Tool, in a new PDFCursorTools module 2017-05-22 00:51:01 +02:00
viewer.html Don't load compatibility.js in the viewer while in non-PRODUCTION mode 2017-08-14 15:57:18 +02:00
viewer.js ES6-ify the code in web/app.js and web/viewer.js 2017-06-30 10:10:01 +02:00