canvasxpress-cli 41.2.60 → 41.2.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cmds/io.js +15 -5
- package/package.json +1 -1
package/cmds/io.js
CHANGED
|
@@ -49,10 +49,20 @@ module.exports = async (obj) => {
|
|
|
49
49
|
//page.on("console", (consoleObj) => console.log(consoleObj.text()));
|
|
50
50
|
|
|
51
51
|
// Print All except warnings
|
|
52
|
-
page.on('console', consoleObj => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
//page.on('console', consoleObj => {
|
|
53
|
+
// if (consoleObj.type() !== 'warning') {
|
|
54
|
+
// console.log(consoleObj.text());
|
|
55
|
+
// }
|
|
56
|
+
//});
|
|
57
|
+
|
|
58
|
+
page.on('console', async msg => {
|
|
59
|
+
const args = await Promise.all(msg.args.map(arg => arg.executionContext().evaluate(arg => {
|
|
60
|
+
if (arg instanceof Error) {
|
|
61
|
+
return arg.message;
|
|
62
|
+
}
|
|
63
|
+
return arg;
|
|
64
|
+
}, arg)));
|
|
65
|
+
console.log(...args);
|
|
56
66
|
});
|
|
57
67
|
|
|
58
68
|
/*
|
|
@@ -139,7 +149,7 @@ module.exports = async (obj) => {
|
|
|
139
149
|
await page.goto(defhtml);
|
|
140
150
|
}
|
|
141
151
|
|
|
142
|
-
await page.
|
|
152
|
+
await page.waitForTimeout(() => typeof (CanvasXpress) !== undefined && CanvasXpress.ready);
|
|
143
153
|
|
|
144
154
|
await page.evaluate(`(${func.toString()})(${JSON.stringify(obj)})`);
|
|
145
155
|
|