Skip to content

feat: Automatically update .wxt/types/paths.d.ts and web_accessible_resources manifest for favicon #1570

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

nishu-murmu
Copy link
Contributor

Overview

As suggested I've used WxtModules to implement this functionality.

Manual Testing

  1. Add favicon permissions wxt.config.ts.
  2. Add this below code for favicon functionality testing.
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();
}

console.log(getFaviconUrl("https://developer.chrome.com/docs/extensions/how-to/ui/favicons"))

Related Issue

This PR closes #1559

Copy link

netlify bot commented Apr 11, 2025

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit 3864cf3
🔍 Latest deploy log https://app.netlify.com/sites/creative-fairy-df92c4/deploys/6800c2c35d6f280009575162
😎 Deploy Preview https://deploy-preview-1570--creative-fairy-df92c4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@nishu-murmu
Copy link
Contributor Author

nishu-murmu commented Apr 11, 2025

@aklinker1
Additionally name of the inbuilt module doesn't seems right, please suggest so I can update accordingly??

@nishu-murmu
Copy link
Contributor Author

@aklinker1
I've updated the name of the builtin module for more generic use case.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's name the module "favicon-permission" instead of "wxt-types". It will only ever have the code for the favicons permission.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you revert this file? The change isn't relevant to the PR. If you want to refactor this, please do it in a separate PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatically update .wxt/types/paths.d.ts and web_accessible_resources manifest for favicon
2 participants