Bug 801676 - [Browser API] Make getScreenshot() use JPEG instead of PNG. r=jlebar
authorGabriele Svelto <gsvelto@mozilla.com>
Mon, 15 Oct 2012 21:54:57 +0200
changeset 110543 8bef5de35c7444f1f25762630b6b0803f70a060f
parent 110542 47ee1a38fe31ebfffd5aea68095b15ccc2446e83
child 110544 04c905ed35017bc98ebf3a3ce66087b39d5b2a0b
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersjlebar
bugs801676
milestone19.0a1
Bug 801676 - [Browser API] Make getScreenshot() use JPEG instead of PNG. r=jlebar
dom/browser-element/BrowserElementChild.js
--- a/dom/browser-element/BrowserElementChild.js
+++ b/dom/browser-element/BrowserElementChild.js
@@ -457,17 +457,17 @@ BrowserElementChild.prototype = {
     var ctx = canvas.getContext("2d");
     canvas.mozOpaque = true;
     canvas.height = content.innerHeight;
     canvas.width = content.innerWidth;
     ctx.drawWindow(content, 0, 0, content.innerWidth,
                    content.innerHeight, "rgb(255,255,255)");
     sendAsyncMsg('got-screenshot', {
       id: data.json.id,
-      rv: canvas.toDataURL("image/png")
+      rv: canvas.toDataURL("image/jpeg")
     });
   },
 
   _recvFireCtxCallback: function(data) {
     debug("Received fireCtxCallback message: (" + data.json.menuitem + ")");
     // We silently ignore if the embedder uses an incorrect id in the callback
     if (data.json.menuitem in this._ctxHandlers) {
       this._ctxHandlers[data.json.menuitem].click();