Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8140499

WebView throws errors when 'use strict' directive is used in scripts

XMLWordPrintable

    • web
    • x86_64
    • windows_7

      FULL PRODUCT VERSION :
      java version "1.8.0_60"
      Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
      Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      I am trying to integrate PDFJS viewer from Mozilla in a WebView. Since updating to java 1.8u60 the viewer is not working anymore with errors from javascript files.

      REGRESSION. Last worked in version 8u45

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.8.0_45"
      Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      See the following StackOverflow question:

      http://stackoverflow.com/questions/33258381/how-to-tell-javafx-webview-to-ignore-use-strict-directive


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      No errors in javascript or a switch to turn off strict mode
      ACTUAL -
      TypeError: undefined is not an object (evaluating 'globalScope.PDFJS') (pdf.worker.js,103)

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      14:29:05.469 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Open URL: file:/C:/data/dev/ias/H92_Interactive_Advisory_Table/target/classes/pdfjs-1.1.366-dist/web/viewer.html
      14:29:05.470 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit NAVIGATE: pFrame = 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/web/viewer.html
      14:29:05.691 [JavaFX Application Thread] DEBUG c.s.w.WebPage - setBounds: 0 0 784 562
      14:29:05.752 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Get title: frame = 4880864
      14:29:05.752 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js
      14:29:05.753 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/web/viewer.css
      14:29:05.754 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/web/compatibility.js
      14:29:05.754 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/web/l10n.js
      14:29:05.754 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/build/pdf.js
      14:29:05.754 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/web/debugger.js
      14:29:05.755 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/web/viewer.js
      14:29:05.755 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Error in fwkFireResourceLoadEvent: unknown request id 1
      14:29:06.719 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/web/images/texture.png
      14:29:06.720 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/web/images/toolbarButton-viewThumbnail.png
      14:29:06.720 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/web/images/toolbarButton-viewOutline.png
      14:29:06.721 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/web/images/toolbarButton-viewAttachments.png
      14:29:06.722 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/web/images/toolbarButton-sidebarToggle.png
      14:29:06.722 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/web/images/toolbarButton-search.png
      14:29:06.723 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/web/images/toolbarButton-pageUp.png
      14:29:06.723 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/web/images/toolbarButton-pageDown.png
      14:29:06.775 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/web/images/toolbarButton-presentationMode.png
      14:29:06.776 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/web/images/toolbarButton-openFile.png
      14:29:06.777 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/web/images/toolbarButton-print.png
      14:29:06.778 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/web/images/toolbarButton-download.png
      14:29:06.778 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/web/images/toolbarButton-bookmark.png
      14:29:06.778 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/web/images/toolbarButton-secondaryToolbarToggle.png
      14:29:06.778 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/web/images/toolbarButton-zoomOut.png
      14:29:06.779 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/web/images/toolbarButton-zoomIn.png
      14:29:06.779 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/web/images/toolbarButton-menuArrows.png
      14:29:06.784 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = http://getfirebug.com/releases/lite/1.2/firebug-lite.css
      14:29:06.786 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit NAVIGATE: pFrame = 1709780704, url = about:blank
      14:29:06.788 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Frame created: frame = 1709780704
      14:29:06.890 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/web/locale/locale.properties
      14:29:06.892 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Get title: frame = 4880864
      14:29:06.893 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/build/pdf.worker.js
      14:29:07.090 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = http://getfirebug.com/releases/lite/1.2/firebug_logo.png
      14:29:07.090 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = http://getfirebug.com/releases/lite/1.2/firebug.gif
      14:29:07.093 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = http://getfirebug.com/releases/lite/1.2/warningIcon.png
      14:29:07.228 [JavaFX Application Thread] DEBUG c.s.w.WebPage - Policy: permit ACCEPT_RESOURCE: pFrame + 4880864, url = http://getfirebug.com/releases/lite/1.2/errorIcon.png
      14:29:07.229 [JavaFX Application Thread] DEBUG c.s.w.WebPage - fwkAddMessageToConsole(): message = TypeError: undefined is not an object (evaluating 'globalScope.PDFJS'), lineNumber = 103, sourceId = file:///C:/data/dev/TestStrict/target/classes/pdfjs-1.1.366-dist/build/pdf.worker.js


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      It is in the StackOverflow question.
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      remove all 'use strict' directives in the javascript files

            ghb Guru Hb (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: