Bug 1015636 - Check if PDF Viewer embed overlay has valid state. r=johns, a=dveditz
authorYury Delendik <ydelendik@mozilla.com>
Wed, 28 May 2014 20:34:02 -0500
changeset 199374 3c82cb80cda67ba703c404aaedbeb861d3225bcb
parent 199373 745d64845c17d282700e13c334f350a6be34a9c1
child 199375 679f59ee1d57530787030b66923b1f0ef077c6f8
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohns, dveditz
bugs1015636
milestone31.0a2
Bug 1015636 - Check if PDF Viewer embed overlay has valid state. r=johns, a=dveditz
browser/extensions/pdfjs/content/PdfRedirector.jsm
--- a/browser/extensions/pdfjs/content/PdfRedirector.jsm
+++ b/browser/extensions/pdfjs/content/PdfRedirector.jsm
@@ -55,16 +55,20 @@ function getObjectUrl(window) {
     element = element.parentNode;
     if (!element) {
       return null; // object tag was not found
     }
     tagName = element.nodeName;
   }
 
   // Checking if overlay is a proper PlayPreview overlay.
+  if (element.displayedType !== element.TYPE_NULL ||
+      element.pluginFallbackType !== element.PLUGIN_PLAY_PREVIEW) {
+    return null; // invalid plugin element overlay state
+  }
   for (var i = 0; i < element.children.length; i++) {
     if (element.children[i] === containerElement) {
       return null; // invalid plugin element overlay
     }
   }
 
   return element.srcURI.spec;
 }