1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-05 15:32:55 +02:00

Remove pushState for safari, fixed Firefox head issue

This commit is contained in:
fchasen 2015-08-11 22:26:29 -04:00
parent e237c76856
commit d730673b9c
12 changed files with 21 additions and 41 deletions

View file

@ -3063,7 +3063,7 @@ EPUBJS.Book.prototype.displayChapter = function(chap, end, deferred){
}, function(error) {
// handle errors in either of the two requests
console.error("Could not load Chapter: "+ chapter.absolute);
console.error("Could not load Chapter: "+ chapter.absolute, error);
book.trigger("book:chapterLoadFailed", chapter.absolute);
book._rendering = false;
defer.reject(error);
@ -3600,14 +3600,14 @@ EPUBJS.Chapter.prototype.render = function(_store){
return this.load().then(function(doc){
var head = doc.head;
var head = doc.querySelector('head');
var base = doc.createElement("base");
base.setAttribute("href", this.absolute);
head.insertBefore(base, head.firstChild);
this.contents = doc;
return new RSVP.Promise(function (resolve, reject) {
this.triggerHooks("beforeChapterRender", function () {
resolve(doc);
@ -6230,11 +6230,6 @@ EPUBJS.Render.Iframe.prototype.load = function(contents, url){
render.docEl.style.right = "0";
}
if(typeof(render.window.history.pushState) != "undefined") {
title = render.headEl.querySelector('title');
render.window.history.pushState(null, title ? title.textContent : '', null);
}
deferred.resolve(render.docEl);
};