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

Commit

Permalink
Hide UI frame unless server error. (#3901)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenba committed Jan 4, 2018
1 parent d0cb37f commit 7d9e51f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions addon/webextension/selector/shooter.js
Expand Up @@ -60,11 +60,7 @@ this.shooter = (function() { // eslint-disable-line no-unused-vars
ctx.scale(window.devicePixelRatio, window.devicePixelRatio);
}
ui.iframe.hide();
try {
ctx.drawWindow(window, selectedPos.left, selectedPos.top, width, height, "#fff");
} finally {
ui.iframe.unhide();
}
ctx.drawWindow(window, selectedPos.left, selectedPos.top, width, height, "#fff");
let limit = buildSettings.pngToJpegCutoff;
let dataUrl = canvas.toDataURL();
if (limit && dataUrl.length > limit) {
Expand Down Expand Up @@ -152,6 +148,8 @@ this.shooter = (function() { // eslint-disable-line no-unused-vars
// The error has been signaled to the user, but unlike other errors (or
// success) we should not abort the selection
deactivateAfterFinish = false;
// We need to unhide the UI since screenshotPage() hides it.
ui.iframe.unhide();
return;
}
if (error.name != "BackgroundError") {
Expand Down

0 comments on commit 7d9e51f

Please sign in to comment.