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.
Files changed (2) hide show
  1. package/cmds/io.js +15 -5
  2. 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
- if (consoleObj.type() !== 'warning') {
54
- console.log(consoleObj.text());
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.waitFor(() => typeof (CanvasXpress) !== undefined && CanvasXpress.ready);
152
+ await page.waitForTimeout(() => typeof (CanvasXpress) !== undefined && CanvasXpress.ready);
143
153
 
144
154
  await page.evaluate(`(${func.toString()})(${JSON.stringify(obj)})`);
145
155
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "canvasxpress-cli",
3
- "version": "41.2.60",
3
+ "version": "41.2.62",
4
4
  "license": {
5
5
  "type": "Dual licensing",
6
6
  "url": "https://www.canvasxpress.org/docs/license.html"