Skip to content

webui.setIcon() does not work as expected #110

@Mqxx

Description

@Mqxx

When trying to set the icon using ``webui.setIcon()` the icon does not get set. This is my code:

import { WebUI } from '@webui/deno-webui'
import icon from '../client/static/favicon.svg' with {type: 'text'}
import { parseArgs } from '@std/cli/parse-args';

const args = parseArgs<{
  develop : boolean | undefined
}>(Deno.args);

const client = new WebUI();

client.setIcon(icon, 'image/svg+xml')


client.setRootFolder('./dist');

client.bind('', (event: WebUI.Event) => {
  console.log(event);
})

client.bind('exit', () => {
  client.close();
});

if (args.develop) {
  client.showBrowser('index.html', WebUI.Browser.Chrome);
} else {
  client.show('index.html');
}

await WebUI.wait();

I can verify that the import is working by logging the icon variable. Also inserting the SVG file directly as a string does not work. Am I doing something wrong? When running webui uses WebView2 on Windows, and it looks like the icon get's not set correctly for WebView2.

Here is my template if anyone is interested.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions