Skip to content

Commit

Permalink
refactor(api/internal/pickers.js): picker user activation
Browse files Browse the repository at this point in the history
- allow '[webview.filesystem.picker] require_user_activation = false' to
  disable user activation requirement for filesystem pickers
  • Loading branch information
jwerle committed Jan 26, 2025
1 parent 8ef87e8 commit 8b46525
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/internal/pickers.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ export const db = new Database()
* @param {string} which
*/
function requireUserActivation (which) {
const requiresUserActivation = String(application.config[`webview_filesystem_picker_require_user_activation`]) !== 'false'
if (!requiresUserActivation) {
return
}

if (globalThis.navigator && 'userActivation' in globalThis.navigator) {
// @ts-ignore
if (globalThis.navigator.userActivation?.isActive === false) {
Expand Down

0 comments on commit 8b46525

Please sign in to comment.