View Single Post
Old 11-11-2016, 10:54 AM   #31
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,748
Karma: 24032915
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by fbrzvnrnd View Post
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.

Last edited by Doitsu; 11-11-2016 at 11:03 AM.
Doitsu is offline   Reply With Quote