maxun-core 0.0.1 → 0.0.3
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/build/interpret.js +11 -2
- package/package.json +1 -1
package/build/interpret.js
CHANGED
|
@@ -103,7 +103,6 @@ class Interpreter extends events_1.EventEmitter {
|
|
|
103
103
|
*/
|
|
104
104
|
getState(page, workflow) {
|
|
105
105
|
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
-
yield page.setViewportSize({ width: 900, height: 400 });
|
|
107
106
|
/**
|
|
108
107
|
* All the selectors present in the current Workflow
|
|
109
108
|
*/
|
|
@@ -252,7 +251,6 @@ class Interpreter extends events_1.EventEmitter {
|
|
|
252
251
|
this.concurrency.addJob(() => __awaiter(this, void 0, void 0, function* () {
|
|
253
252
|
try {
|
|
254
253
|
const newPage = yield context.newPage();
|
|
255
|
-
yield newPage.setViewportSize({ width: 900, height: 400 });
|
|
256
254
|
yield newPage.goto(link);
|
|
257
255
|
yield newPage.waitForLoadState('networkidle');
|
|
258
256
|
yield this.runLoop(newPage, this.initializedWorkflow);
|
|
@@ -524,6 +522,17 @@ class Interpreter extends events_1.EventEmitter {
|
|
|
524
522
|
*/
|
|
525
523
|
run(page, params) {
|
|
526
524
|
return __awaiter(this, void 0, void 0, function* () {
|
|
525
|
+
this.log('Starting the workflow.', logger_1.Level.LOG);
|
|
526
|
+
const context = page.context();
|
|
527
|
+
// Check proxy settings from context options
|
|
528
|
+
const contextOptions = context._options;
|
|
529
|
+
const hasProxy = !!(contextOptions === null || contextOptions === void 0 ? void 0 : contextOptions.proxy);
|
|
530
|
+
this.log(`Proxy settings: ${hasProxy ? `Proxy is configured...` : 'No proxy configured...'}`);
|
|
531
|
+
if (hasProxy) {
|
|
532
|
+
if (contextOptions.proxy.username) {
|
|
533
|
+
this.log(`Proxy authenticated...`);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
527
536
|
if (this.stopper) {
|
|
528
537
|
throw new Error('This Interpreter is already running a workflow. To run another workflow, please, spawn another Interpreter.');
|
|
529
538
|
}
|