Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Use an object url for the preview image. (#3940)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenba committed Jan 9, 2018
1 parent 7b7e5da commit 9e56cf2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions addon/webextension/selector/ui.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* globals log, util, catcher, inlineSelectionCss, callBackground, assertIsTrusted, assertIsBlankDocument, buildSettings */
/* globals log, util, catcher, inlineSelectionCss, callBackground, assertIsTrusted, assertIsBlankDocument, buildSettings blobConverters */

"use strict";

@@ -900,7 +900,8 @@ this.ui = (function() { // eslint-disable-line no-unused-vars
exports.Preview = {
display(dataUrl, showCropWarning) {
let img = makeEl("IMG");
img.src = dataUrl;
let imgBlob = blobConverters.dataUrlToBlob(dataUrl);
img.src = URL.createObjectURL(imgBlob);
iframe.document().querySelector(".preview-image").appendChild(img);
if (showCropWarning && !(isDownloadOnly())) {
let imageCroppedEl = makeEl("table", "notice");

0 comments on commit 9e56cf2

Please sign in to comment.