Skip to content

Omit the dialog title of alert() and confirm() #2518

Closed

Description

@duanyao

Currently dialogs triggered by alert() and confirm() in Electron has the title of application name specified in package.json.

My application is a multi-language one, so I decided that the name in package.json is always in english for consistancy (the data directory of the app is also determined by application name). However, I don't want non-English spoken users to see the English application name in the title of dialogs because this is not user-friendly.

I think Electron may omit the dialog title of alert() and confirm(), because they are model dialogs so users always know where the dialog come from. Firefox already does this and I feel well with it.

Activity

  1. etiktin commented on Aug 19, 2015

    @etiktin
    Contributor

    If you want to change the title to some translated text, you can do that with the current release.
    It turns out the current implementation extends alert and confirm with a second parameter. If you set it to a non empty string, that string will be displayed as the title of the dialog. For example alert("I am an alert box!", "Foobar"); will show the title Foobar.

    I know it's not exactly what you wanted but I thought it might still help you.

  2. duanyao commented on Aug 19, 2015

    @duanyao
    Author

    Interesting, it does help, thanks!

  3. zcbenz commented on Aug 25, 2015

    @zcbenz
    Contributor

    If you want full control of the dialog you should use the dialog module, the implementation of alert is for compatibility with existing web pages so we won't give it much flexibility.

  4. duanyao commented on Aug 25, 2015

    @duanyao
    Author

    I don't see any compatibility issue here. The spec says nothing about the dialog title of alert() etc., and not all browers show a title. Anyway, I use alert(msg, ' ') now as suggested above.

  5. pjdon commented on May 23, 2021

    @pjdon

    @etiktin This did not work for me in version 1.12.4. Was support for this removed? I can't find any information.

  6. etiktin commented on May 23, 2021

    @etiktin
    Contributor

    @pjdon this is an old closed issue. Many things changed since then, so maybe it's no longer supported. I suggest you open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions