Comparing version 1.0.2 to 1.0.3
@@ -10,6 +10,6 @@ 'use strict'; | ||
var page; | ||
return browser.newPage().then(function ($await_4) { | ||
return browser.newPage().then(function ($await_5) { | ||
try { | ||
page = $await_4; | ||
return page.goto(url).then(function ($await_5) { | ||
page = $await_5; | ||
return page.goto(url).then(function ($await_6) { | ||
try { | ||
@@ -20,5 +20,5 @@ if (manually) { | ||
window[typeof manually === 'string' ? manually : 'snapshot'] = resolve; | ||
})).then(function ($await_6) { | ||
})).then(function ($await_7) { | ||
try { | ||
return $If_2.call(this); | ||
return $If_3.call(this); | ||
} catch ($boundEx) { | ||
@@ -29,5 +29,5 @@ return $error($boundEx); | ||
} else { | ||
return page.waitFor(wait).then(function ($await_7) { | ||
return page.waitFor(wait).then(function ($await_8) { | ||
try { | ||
return $If_2.call(this); | ||
return $If_3.call(this); | ||
} catch ($boundEx) { | ||
@@ -39,3 +39,3 @@ return $error($boundEx); | ||
function $If_2() { | ||
function $If_3() { | ||
return $return(page.content()); | ||
@@ -57,15 +57,16 @@ } | ||
var browser, result; | ||
return puppeteer.launch().then(function ($await_8) { | ||
return puppeteer.launch().then(function ($await_9) { | ||
try { | ||
browser = $await_8; | ||
return new Promise(function ($return, $error) { | ||
if (Array.isArray(options)) { | ||
return Promise.all(options.map(option => getHTML(browser, option))).then($return, $error); | ||
}return getHTML(browser, options).then($return, $error); | ||
}.bind(this)).then(function ($await_11) { | ||
browser = $await_9; | ||
var $Try_1_Post = function () { | ||
try { | ||
result = $await_11; | ||
return browser.close().then(function ($await_12) { | ||
return $return(); | ||
} catch ($boundEx) { | ||
return $error($boundEx); | ||
} | ||
}.bind(this);var $Try_1_Catch = function (err) { | ||
try { | ||
return browser.close().then(function ($await_10) { | ||
try { | ||
return $return(result); | ||
throw err; | ||
} catch ($boundEx) { | ||
@@ -78,3 +79,25 @@ return $error($boundEx); | ||
} | ||
}.bind(this), $error); | ||
}.bind(this); | ||
try { | ||
return new Promise(function ($return, $error) { | ||
if (Array.isArray(options)) { | ||
return Promise.all(options.map(option => getHTML(browser, option))).then($return, $error); | ||
}return getHTML(browser, options).then($return, $error); | ||
}.bind(this)).then(function ($await_13) { | ||
try { | ||
result = $await_13; | ||
return browser.close().then(function ($await_14) { | ||
try { | ||
return $return(result); | ||
} catch ($boundEx) { | ||
return $Try_1_Catch($boundEx); | ||
} | ||
}.bind(this), $Try_1_Catch); | ||
} catch ($boundEx) { | ||
return $Try_1_Catch($boundEx); | ||
} | ||
}.bind(this), $Try_1_Catch); | ||
} catch (err) { | ||
$Try_1_Catch(err); | ||
} | ||
} catch ($boundEx) { | ||
@@ -81,0 +104,0 @@ return $error($boundEx); |
{ | ||
"name": "taki", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Take a snapshot of any website.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -84,3 +84,3 @@ # taki | ||
This option will be ignored if [manually](#manually) is set. | ||
This option will be ignored if [manually](#manually-take-snapshot) is set. | ||
@@ -87,0 +87,0 @@ ## Contributing |
8350
98