feat(electron): add allow list for recording apps (#11321)
This commit is contained in:
@@ -0,0 +1,43 @@
|
|||||||
|
// the following apps are sorted by the name in alphabetical order
|
||||||
|
const appNameKeywords = new Set([
|
||||||
|
'arc',
|
||||||
|
'boardmix',
|
||||||
|
'brave',
|
||||||
|
'chrome',
|
||||||
|
'chromium',
|
||||||
|
'classin',
|
||||||
|
'dia',
|
||||||
|
'dingtalk',
|
||||||
|
'discord',
|
||||||
|
'edge',
|
||||||
|
'facetime',
|
||||||
|
'feishu',
|
||||||
|
'figma',
|
||||||
|
'firefox',
|
||||||
|
'lark',
|
||||||
|
'meet',
|
||||||
|
'messenger',
|
||||||
|
'opera',
|
||||||
|
'qq',
|
||||||
|
'safari',
|
||||||
|
'skype',
|
||||||
|
'slack',
|
||||||
|
'telegram',
|
||||||
|
'tim',
|
||||||
|
'vivaldi',
|
||||||
|
'webex',
|
||||||
|
'wechat',
|
||||||
|
'whatsapp',
|
||||||
|
'wire',
|
||||||
|
'zen',
|
||||||
|
'zoom',
|
||||||
|
]);
|
||||||
|
|
||||||
|
export function isAppNameAllowed(name: string) {
|
||||||
|
for (const keyword of appNameKeywords) {
|
||||||
|
if (name.toLowerCase().includes(keyword.toLowerCase())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
@@ -28,6 +28,7 @@ import {
|
|||||||
import { globalStateStorage } from '../shared-storage/storage';
|
import { globalStateStorage } from '../shared-storage/storage';
|
||||||
import { getMainWindow } from '../windows-manager';
|
import { getMainWindow } from '../windows-manager';
|
||||||
import { popupManager } from '../windows-manager/popup';
|
import { popupManager } from '../windows-manager/popup';
|
||||||
|
import { isAppNameAllowed } from './allow-list';
|
||||||
import { recordingStateMachine } from './state-machine';
|
import { recordingStateMachine } from './state-machine';
|
||||||
import type {
|
import type {
|
||||||
AppGroupInfo,
|
AppGroupInfo,
|
||||||
@@ -390,7 +391,8 @@ function getAllApps(): TappableAppInfo[] {
|
|||||||
v !== null &&
|
v !== null &&
|
||||||
!v.bundleIdentifier.startsWith('com.apple') &&
|
!v.bundleIdentifier.startsWith('com.apple') &&
|
||||||
!v.bundleIdentifier.startsWith('pro.affine') &&
|
!v.bundleIdentifier.startsWith('pro.affine') &&
|
||||||
v.processId !== process.pid
|
v.processId !== process.pid &&
|
||||||
|
isAppNameAllowed(v.name)
|
||||||
);
|
);
|
||||||
return filteredApps;
|
return filteredApps;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user