Skip to content

Invoke-UDJavascript Returns null Unexpectedly #4149

Closed
@parzog

Description

@parzog

Description of Issue

Reference forum post #11799 - When attempting to run Invoke-UDJavascript without user interaction to return a value (such as using window.localStorage.theme to retrieve the current user's dark/light mode selection) returns null instead of the value expected. The output is correct when ran with user interaction, such as the following:

New-UDApp -Content {
    New-UDButton -Text "h" -OnClick {
        Show-UDToast -Duration 10000 (Invoke-UDJavascript -Javascript "window.localStorage.theme")
    }
}

Version

5.0.15

Severity

Low

Hosting Method

IIS

Operating System

Windows

Database

SQLite

Licensed

Yes

Features

git push only

Additional Environment data

azure app proxy

Screenshots/Animations

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-AppsThis issue is related to apps (dashboards).P4 - lowBug has minimal impact, general usage not affected.Size - SThis issue is a small amount of work.v5Version 5 issue.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions