Quote:
Originally Posted by fbrzvnrnd
This because some ebook readers (Lekt on Android and Azardi) give error when meet navigator.epubReadingSystem.name and stop the jevascript code.
|
I only have rudimentary JavaScript skills but checking
navigator.hasOwnProperty should allow you to find out whether an epub3 app supports
epubReadingSystem. (Apps that don't support
epubReadingSystem usually only have minimal epub3 support.)
For a ready-made example, see this very simple
epub3 test file, which uses the following code:
Code:
function showinfo() {
if (navigator && navigator.hasOwnProperty('epubReadingSystem')) {
var versionInfo = "name: " + navigator.epubReadingSystem.name + " " + navigator.epubReadingSystem.version + "\nplatform: " + navigator.platform + "\nlayoutStyle: " + navigator.epubReadingSystem.layoutStyle + "\n";
var features = ["dom-manipulation", "layout-changes", "touch-events", "mouse-events", "keyboard-events", "spine-scripting"];
var featureLog = "";
for (var i = 0; i < 6; i++) {
if (navigator.epubReadingSystem.hasFeature(features[i])) {
featureLog += features[i] + ": supported\n";
} else {
featureLog += features[i] + ": NOT supported\n";
}
}
alert(versionInfo + featureLog);
} else {
alert('epubReadingSystem object not found.' + "\nappName: " + navigator.appName + "\nappVersion: " + navigator.appVersion + "\nplatform: " + navigator.platform);
}
}
It'll return Netscape as the
navigator.appName value for Sigil, Azardi
and Lektz. IMHO,
Gitden Reader is usually better at rendering epub3 books than Lektz.