How to use logUsage flag to shell.openExternal() in Electron?

34 Views Asked by At

Electron 24 has added a flag logUsage to shell.openExternal() but is not very clear to me, when it should be (or should not be) used?

From Electron.js 24 Release Notes:

Added logUsage to shell.openExternal() options, which allows passing the SEE_MASK_FLAG_LOG_USAGE flag to ShellExecuteEx on Windows. The SEE_MASK_FLAG_LOG_USAGE flag indicates a user initiated launch that enables tracking of frequently used programs and other behaviors.

All actions are directly or indirectly user initiated in a typical app. So, it seems to me, the flag should be logUsage: true always. The question is, when to set the flag to false? E.g. these use cases when shell.openExternal() may be executed:

  • User action to open URL from her data (content) - it clear that logUsage: true.
  • User action to open internal app help. The app author decides that the help is in external files and also decides format of these files (PDF, HTML, ...). So, the action is user initiated, but it's a kind of internal app stuff. Should be logUsage: false in this case?
  • Other app action examples where should be logUsage: false?

(Windows SHELLEXECUTEINFOA structure documentation is not much helpful neither.)

0

There are 0 best solutions below