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 { GBAdminService } from '../../admin.gbapp/services/GBAdminService';
|
||||
const DateDiff = require('date-diff');
|
||||
|
||||
import { createBrowser } from '../../core.gbapp/services/GBSSR';
|
||||
|
||||
const Path = require('path');
|
||||
const sgMail = require('@sendgrid/mail');
|
||||
|
@ -130,10 +130,7 @@ export class DialogKeywords {
|
|||
public async getPage(step, url, username, password) {
|
||||
GBLog.info(`BASIC: Web Automation GET PAGE ${url}.`);
|
||||
if (!this.browser) {
|
||||
this.browser =
|
||||
|
||||
// set the HTTP Basic Authentication credential
|
||||
|
||||
this.browser = await createBrowser(null);
|
||||
}
|
||||
const page = await this.browser.newPage();
|
||||
if (username || password) {
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
const puppeteer = require('puppeteer');
|
||||
const pluginStealth = require('puppeteer-extra-plugin-stealth');
|
||||
import { NextFunction, Request, Response } from "express";
|
||||
import { Browser } from "puppeteer";
|
||||
const Path = require('path');
|
||||
|
||||
// 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`;
|
||||
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 = {};
|
||||
|
||||
try {
|
||||
|
|
Loading…
Add table
Reference in a new issue