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

Add canonical option, fix base tag for Safari

This commit is contained in:
Fred Chasen 2017-09-21 22:10:58 -07:00
parent ec0325f122
commit 9f0623b798
6 changed files with 42 additions and 11 deletions

View file

@ -352,11 +352,11 @@ class IframeView {
var link = this.document.querySelector("link[rel='canonical']");
if (link) {
link.setAttribute("href", this.section.url);
link.setAttribute("href", this.section.canonical);
} else {
link = this.document.createElement("link");
link.setAttribute("rel", "canonical");
link.setAttribute("href", this.section.url);
link.setAttribute("href", this.section.canonical);
this.document.querySelector("head").appendChild(link);
}