Skip to content

Commit

Permalink
should fix broken Chrome app "bookmark" (reading location) save/restore
Browse files Browse the repository at this point in the history
#683 (needs testing in both Chrome app, and cloud reader for regressions)
  • Loading branch information
danielweck committed Jan 18, 2018
1 parent ad7fa32 commit e081018
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/js/EpubReader.js
Original file line number Diff line number Diff line change
Expand Up @@ -757,10 +757,6 @@ BookmarkData){

var savePlace = function(){

var urlParams = Helpers.getURLQueryParams();
var ebookURL = urlParams['epub'];
if (!ebookURL) return;

var bookmarkString = readium.reader.bookmarkCurrentPage();
// Note: automatically JSON.stringify's the passed value!
// ... and bookmarkCurrentPage() is already JSON.toString'ed, so that's twice!
Expand All @@ -769,6 +765,10 @@ BookmarkData){
if (!isChromeExtensionPackagedApp // History API is disabled in packaged apps
&& window.history && window.history.replaceState) {

var urlParams = Helpers.getURLQueryParams();
var ebookURL = urlParams['epub'];
if (!ebookURL) return;

ebookURL = ensureUrlIsRelativeToApp(ebookURL);
var bookmark = JSON.parse(bookmarkString) || {};
var epubs = urlParams['epubs'];
Expand Down

0 comments on commit e081018

Please sign in to comment.