summaryrefslogtreecommitdiffstats
path: root/devtools/server
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-07-18 08:24:24 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-07-18 08:24:24 +0200
commitfc61780b35af913801d72086456f493f63197da6 (patch)
treef85891288a7bd988da9f0f15ae64e5c63f00d493 /devtools/server
parent69f7f9e5f1475891ce11cc4f431692f965b0cd30 (diff)
parent50d3e596bbe89c95615f96eb71f6bc5be737a1db (diff)
downloadUXP-2018.07.18.tar
UXP-2018.07.18.tar.gz
UXP-2018.07.18.tar.lz
UXP-2018.07.18.tar.xz
UXP-2018.07.18.zip
Merge commit '50d3e596bbe89c95615f96eb71f6bc5be737a1db' into Basilisk-releasev2018.07.18
# Conflicts: # browser/app/profile/firefox.js # browser/components/preferences/jar.mn
Diffstat (limited to 'devtools/server')
-rw-r--r--devtools/server/actors/highlighters/eye-dropper.js30
1 files changed, 16 insertions, 14 deletions
diff --git a/devtools/server/actors/highlighters/eye-dropper.js b/devtools/server/actors/highlighters/eye-dropper.js
index a90ec22bd..bbfa2d78c 100644
--- a/devtools/server/actors/highlighters/eye-dropper.js
+++ b/devtools/server/actors/highlighters/eye-dropper.js
@@ -191,20 +191,22 @@ EyeDropper.prototype = {
},
prepareImageCapture() {
- // Get the image data from the content window.
- let imageData = getWindowAsImageData(this.win);
-
- // We need to transform imageData to something drawWindow will consume. An ImageBitmap
- // works well. We could have used an Image, but doing so results in errors if the page
- // defines CSP headers.
- this.win.createImageBitmap(imageData).then(image => {
- this.pageImage = image;
- // We likely haven't drawn anything yet (no mousemove events yet), so start now.
- this.draw();
+ // Get the canvas from the content window.
+ let canvas = getWindowAsImageData(this.win);
+
+ canvas.toBlob(blob => {
+ // We need to transform imageData to something drawWindow will consume. An ImageBitmap
+ // works well. We could have used an Image, but doing so results in errors if the page
+ // defines CSP headers.
+ this.win.createImageBitmap(blob).then(image => {
+ this.pageImage = image;
+ // We likely haven't drawn anything yet (no mousemove events yet), so start now.
+ this.draw();
- // Set an attribute on the root element to be able to run tests after the first draw
- // was done.
- this.getElement("root").setAttribute("drawn", "true");
+ // Set an attribute on the root element to be able to run tests after the first draw
+ // was done.
+ this.getElement("root").setAttribute("drawn", "true");
+ });
});
},
@@ -486,7 +488,7 @@ function getWindowAsImageData(win) {
ctx.scale(scale, scale);
ctx.drawWindow(win, win.scrollX, win.scrollY, width, height, "#fff");
- return ctx.getImageData(0, 0, canvas.width, canvas.height);
+ return canvas;
}
/**