mirror of
https://github.com/chinchang/web-maker.git
synced 2025-04-05 03:12:25 +02:00
takeScreenshot: remove debugger
This commit is contained in:
parent
c52a2f45f3
commit
fb016d9580
@ -1,6 +1,4 @@
|
||||
import {
|
||||
handleDownloadsPermission
|
||||
} from "./utils";
|
||||
import { handleDownloadsPermission } from './utils';
|
||||
|
||||
function saveScreenshot(dataURI) {
|
||||
// convert base64 to raw binary data held in a string
|
||||
@ -45,10 +43,11 @@ function saveScreenshot(dataURI) {
|
||||
'/temporary/' +
|
||||
fileName;
|
||||
|
||||
chrome.downloads.download({
|
||||
chrome.downloads.download(
|
||||
{
|
||||
url: filePath
|
||||
},
|
||||
function () {
|
||||
function() {
|
||||
// If there was an error, just open the screenshot in a tab.
|
||||
// This happens in incognito mode where extension cannot access filesystem.
|
||||
if (chrome.runtime.lastError) {
|
||||
@ -68,7 +67,8 @@ function saveScreenshot(dataURI) {
|
||||
size,
|
||||
fs => {
|
||||
fs.root.getFile(
|
||||
fileName, {
|
||||
fileName,
|
||||
{
|
||||
create: true
|
||||
},
|
||||
fileEntry => {
|
||||
@ -116,13 +116,13 @@ export function takeScreenshot(boundRect) {
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
debugger
|
||||
chrome.tabs.captureVisibleTab(
|
||||
null, {
|
||||
null,
|
||||
{
|
||||
format: 'png',
|
||||
quality: 100
|
||||
},
|
||||
function (dataURI) {
|
||||
function(dataURI) {
|
||||
s.remove();
|
||||
if (dataURI) {
|
||||
var image = new Image();
|
||||
@ -135,4 +135,4 @@ export function takeScreenshot(boundRect) {
|
||||
|
||||
trackEvent('ui', 'takeScreenshotBtnClick');
|
||||
});
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user