mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-14 18:00:45 +08:00
fix: improve WhatsApp settings and isolate IM host authentication
Some checks are pending
CI / Test, build, and verify package (push) Waiting to run
Some checks are pending
CI / Test, build, and verify package (push) Waiting to run
This commit is contained in:
parent
bcbe85fdb1
commit
bf73b0c0af
28 changed files with 848 additions and 116 deletions
10
plugin-src/host/harness-host-context.mjs
Normal file
10
plugin-src/host/harness-host-context.mjs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
/** Run same-process IM operations without inheriting a browser's UDS identity. */
|
||||
export function runHarnessHostOperation(ctx, operation) {
|
||||
// Cordis property access requires inject even for an optional service.
|
||||
// ctx.get() supports dynamic lookup without making UDS a startup dependency.
|
||||
const auth = typeof ctx?.get === 'function' ? ctx.get('udsAuth') : ctx?.udsAuth;
|
||||
// Resolve on every call: auth can become ready or reload after IM starts.
|
||||
return typeof auth?.runAsHost === 'function'
|
||||
? auth.runAsHost(operation)
|
||||
: operation();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue