Skip to content

Automatically update .wxt/types/paths.d.ts and web_accessible_resources manifest for favicon #1559

@ImSingee

Description

@ImSingee

Feature Request

For favicon feature: https://developer.chrome.com/docs/extensions/how-to/ui/favicons

Currently, if we want to use this, we have to do following steps:

  1. Update permissions in wxt.config.ts to include favicon
  2. Update web_accessible_resources in manifest to allow _favicon/*
  3. We have to add @ts-ignore or @ts-expect-error when requesting favicon url (since it's not allowed by .wxt/types/paths.d.ts)
function getFaviconUrl(url: string, size = 16) {
  //@ts-expect-error not supported by wxt now
  const u = new URL(browser.runtime.getURL("/_favicon/"));
  u.searchParams.set("pageUrl", url);
  u.searchParams.set("size", size.toString());
  return u.toString();
}

I expect to use this feature as easily as just adding the favicon permission.

Is your feature request related to a bug?

N/A

What are the alternatives?

N/A

Additional context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions