Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature | Browser tab title and favicon should match the stage’s title and first icon. #185

Closed
besidev opened this issue Sep 27, 2024 · 1 comment
Assignees

Comments

@besidev
Copy link

besidev commented Sep 27, 2024

Feature description:

When opening a stage, especially via the WebAPI.openStageAsTab method, the browser tab should display the stage's title and icon as favicon, ensuring a consistent and recognizable branding for the application.

Actual Behavior:

Currently, the tab displays as title the following string JPro Application: ?instanceID=1234567890, where the instanceID is automatically generated by JPro depending on the different configuration options and the default JPro favicon is used as favicon. The following is an example application opening 3 tabs:

screenshot-actual-behavior

Expected Behavior:

The newly created tab should display the stage’s title as the tab title and the favicon should be the first icon from the stage’s getIcons list. These should match the value of the title property and the first icon in the getIcons list, respectively.

Environment:

  • JavaFX version: 17+
  • JPro version: 2024.3.3 and any previous version
  • Browser: Any browser
  • Operating System: Any supported platform (Linux, Windows, macOS)
@besidev besidev self-assigned this Sep 27, 2024
@besidev
Copy link
Author

besidev commented Nov 5, 2024

This feature is now available on JPro version 2024.4.0.

The browser tab now accurately reflects the JavaFX stage's title and favicon. The tab title is set based on the stage's title property, and the favicon is sourced from the first icon in the stage's getIcons list. To enable this feature, use the syncStageAttributes attribute in the jpro-app tag.

For example, just add this line to your index.html file on your project:

<!DOCTYPE html>

<html>
<head>
    <title>JPro Web application</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="description" content="Some description">

    <link rel="stylesheet" type="text/css" href="/jpro/css/jpro-fullscreen.css">
    <link rel="stylesheet" type="text/css" href="/jpro/css/jpro.css">

    <script src="/jpro/js/jpro.js" type="text/javascript"></script>
</head>

<body>
    <jpro-app href="/app/default" syncStageAttributes="true"></jpro-app>
</body>

</html>

@besidev besidev closed this as completed Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant