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

Idea: Read name / icon from manifest.json #20

Open
redeye86 opened this issue May 17, 2024 · 1 comment
Open

Idea: Read name / icon from manifest.json #20

redeye86 opened this issue May 17, 2024 · 1 comment

Comments

@redeye86
Copy link
Contributor

Wouldn't it make sense to read the name and icon of the app from the manifest.json? It is json anyway and linked in the of the page.
I am using the script in a multi-site installation and it is invoked from inside a javascript file that is not site specific. So I don't have the information about the name in the first place. At first I thought about reading the application name and icon path from some data-attribute (in body or html tag). But the manifest has to be linked anyway for this to work and the name and icon could be used as the default.

@redeye86
Copy link
Contributor Author

redeye86 commented May 17, 2024

I just found out it is even easier. Manifest information is available using an api and does not have to be fetched manually:
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/getManifest#parameters

Does not work in normal website context. It seems that the file has to be downloaded manually actually.

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

No branches or pull requests

1 participant