diff --git a/src/config.ts b/src/config.ts index 20213f080c..3ad5937e0b 100644 --- a/src/config.ts +++ b/src/config.ts @@ -26,7 +26,11 @@ * ``` */ export interface Config { - deviceName: string; + /** + * Set the device name connected, false to disable + * @default 'WPPConnect' + */ + deviceName: string | false; } export const defaultConfig: Config = { diff --git a/src/deviceName.ts b/src/deviceName.ts index 24a665aa6d..1259a8b163 100644 --- a/src/deviceName.ts +++ b/src/deviceName.ts @@ -14,18 +14,21 @@ * limitations under the License. */ -import * as packageJSON from '../package.json'; import { config } from './config'; import * as webpack from './webpack'; // Update deviceName connected webpack.onInjected(() => { + if (!config.deviceName) { + return; + } + const m = webpack.search((m) => m.default.info && m.default.hardRefresh); if (m) { const info = m.default.info(); info.os = config.deviceName; - info.version = `${packageJSON.version}`; + info.version = undefined; info.name = undefined; info.ua = undefined;