Skip to content

Commit 8b46525

Browse files
committed
refactor(api/internal/pickers.js): picker user activation
- allow '[webview.filesystem.picker] require_user_activation = false' to disable user activation requirement for filesystem pickers
1 parent 8ef87e8 commit 8b46525

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

api/internal/pickers.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ export const db = new Database()
4343
* @param {string} which
4444
*/
4545
function requireUserActivation (which) {
46+
const requiresUserActivation = String(application.config[`webview_filesystem_picker_require_user_activation`]) !== 'false'
47+
if (!requiresUserActivation) {
48+
return
49+
}
50+
4651
if (globalThis.navigator && 'userActivation' in globalThis.navigator) {
4752
// @ts-ignore
4853
if (globalThis.navigator.userActivation?.isActive === false) {

0 commit comments

Comments
 (0)