mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-08 19:39:40 +08:00
Merge branch '1.23.X' into 1.23.13-to-2.0.0
# Conflicts: # .github/workflows/auto-test.yml # package-lock.json # package.json # server/database.js # server/model/monitor.js # server/monitor-types/real-browser-monitor-type.js # server/util-server.js # test/cypress/unit/i18n.spec.js
This commit is contained in:
@@ -10,6 +10,10 @@ const jwt = require("jsonwebtoken");
|
||||
const config = require("../config");
|
||||
const { RemoteBrowser } = require("../remote-browser");
|
||||
|
||||
/**
|
||||
* Cached instance of a browser
|
||||
* @type {import ("playwright-core").Browser}
|
||||
*/
|
||||
let browser = null;
|
||||
|
||||
let allowedList = [];
|
||||
@@ -71,10 +75,12 @@ async function isAllowedChromeExecutable(executablePath) {
|
||||
/**
|
||||
* Get the current instance of the browser. If there isn't one, create
|
||||
* it.
|
||||
* @returns {Promise<Browser>} The browser
|
||||
* @returns {Promise<import ("playwright-core").Browser>} The browser
|
||||
*/
|
||||
async function getBrowser() {
|
||||
if (!browser) {
|
||||
if (browser && browser.isConnected()) {
|
||||
return browser;
|
||||
} else {
|
||||
let executablePath = await Settings.get("chromeExecutable");
|
||||
|
||||
executablePath = await prepareChromeExecutable(executablePath);
|
||||
@@ -83,8 +89,9 @@ async function getBrowser() {
|
||||
//headless: false,
|
||||
executablePath,
|
||||
});
|
||||
|
||||
return browser;
|
||||
}
|
||||
return browser;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user