new(all): Custom Domain support per bot.
This commit is contained in:
parent
e8be1c29b4
commit
c29efe794c
2 changed files with 4 additions and 8 deletions
|
@ -45,7 +45,7 @@ import { HubSpotServices } from '../../hubspot.gblib/services/HubSpotServices';
|
||||||
import { WhatsappDirectLine } from '../../whatsapp.gblib/services/WhatsappDirectLine';
|
import { WhatsappDirectLine } from '../../whatsapp.gblib/services/WhatsappDirectLine';
|
||||||
import { GBAdminService } from '../../admin.gbapp/services/GBAdminService';
|
import { GBAdminService } from '../../admin.gbapp/services/GBAdminService';
|
||||||
const DateDiff = require('date-diff');
|
const DateDiff = require('date-diff');
|
||||||
|
import { createBrowser } from '../../core.gbapp/services/GBSSR';
|
||||||
|
|
||||||
const Path = require('path');
|
const Path = require('path');
|
||||||
const sgMail = require('@sendgrid/mail');
|
const sgMail = require('@sendgrid/mail');
|
||||||
|
@ -130,10 +130,7 @@ export class DialogKeywords {
|
||||||
public async getPage(step, url, username, password) {
|
public async getPage(step, url, username, password) {
|
||||||
GBLog.info(`BASIC: Web Automation GET PAGE ${url}.`);
|
GBLog.info(`BASIC: Web Automation GET PAGE ${url}.`);
|
||||||
if (!this.browser) {
|
if (!this.browser) {
|
||||||
this.browser =
|
this.browser = await createBrowser(null);
|
||||||
|
|
||||||
// set the HTTP Basic Authentication credential
|
|
||||||
|
|
||||||
}
|
}
|
||||||
const page = await this.browser.newPage();
|
const page = await this.browser.newPage();
|
||||||
if (username || password) {
|
if (username || password) {
|
||||||
|
|
|
@ -39,7 +39,6 @@
|
||||||
const puppeteer = require('puppeteer');
|
const puppeteer = require('puppeteer');
|
||||||
const pluginStealth = require('puppeteer-extra-plugin-stealth');
|
const pluginStealth = require('puppeteer-extra-plugin-stealth');
|
||||||
import { NextFunction, Request, Response } from "express";
|
import { NextFunction, Request, Response } from "express";
|
||||||
import { Browser } from "puppeteer";
|
|
||||||
const Path = require('path');
|
const Path = require('path');
|
||||||
|
|
||||||
// https://hackernoon.com/tips-and-tricks-for-web-scraping-with-puppeteer-ed391a63d952
|
// https://hackernoon.com/tips-and-tricks-for-web-scraping-with-puppeteer-ed391a63d952
|
||||||
|
@ -82,7 +81,7 @@ const RENDER_CACHE = new Map();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async function createBrowser(profile): Promise<Browser> {
|
async function createBrowser(profile): Promise<any> {
|
||||||
const gbaiName = `${this.min.botId}.gbai`;
|
const gbaiName = `${this.min.botId}.gbai`;
|
||||||
let localName = Path.join('work', gbaiName, 'profile');
|
let localName = Path.join('work', gbaiName, 'profile');
|
||||||
|
|
||||||
|
@ -141,7 +140,7 @@ async function ssr(url: string, useCache: boolean, cacheRefreshRate: number) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const browser = createBrowser(null);
|
const browser = await createBrowser(null);
|
||||||
const stylesheetContents = {};
|
const stylesheetContents = {};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Add table
Reference in a new issue