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:
parent
ec0325f122
commit
9f0623b798
6 changed files with 42 additions and 11 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue