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 request] Allow configuration through Firefox policies #4600

Open
bodby opened this issue Jan 2, 2025 · 3 comments
Open

[Feature request] Allow configuration through Firefox policies #4600

bodby opened this issue Jan 2, 2025 · 3 comments

Comments

@bodby
Copy link

bodby commented Jan 2, 2025

I can't define default options for the extension. The only apparent way to be able to copy configurations over to other machines is to download the backup JSON file from the extension's configuration page and then manually restore using that file.

uBlock supports configuration through policies, and I was wondering if I'm doing something wrong or if this isn't currently possible with Vimium. There's even a GitHub page by Mozilla using uBlock as an example.

I should note that I am using Home Manager, though it works just fine for uBlock and other policy configurations.

To Reproduce

  1. Try to define policy with contents of backed up vimium-options.json file, or even just a single option like scrollStepSize (either through Nix or normally).
  2. Vimium does not load the configuration.

See "3rdparty".Extensions; the other options are unimportant:

2025-01-02_01-30-14

2025-01-02_01-30-54

Browser and Vimium version

Firefox version 133.0.3 on Linux 6.12.7 #1-NixOS SMP PREEMPT_DYNAMIC Fri Dec 27 13:02:20 UTC 2024

Vimium version 2.1.2

@philg-dev
Copy link

From what I've seen behind one of your links regarding "Adding policy support to your extension" it looks like policies work by using the browser.storage.managed API.

I can't find any usages of storage.managed in Vimium's codebase, so you're not doing anything wrong - it's just not supported at this point.

@bodby
Copy link
Author

bodby commented Jan 2, 2025

Thanks for the quick response!

Don't know much about browsers; is storage.managed the only way extensions can read the policy, or any other file/data for that matter?

@philg-dev
Copy link

That seems to be the only way that policies are handled by addons, yeah. It wouldn't make much sense to have multiple ways of doing it - that's what a uniform API is there for - to provide a uniform interface for a use cases that might be handled differently behind the scenes by different browsers or on different platforms.

It's a different mechanism than what is used for saving / restoring a backup.

Aside from that browsers have their own way of storing the extension settings locally. I think that's usually in SQLite file databases, but I'm not sure how exactly it works or if there's differences among browsers, etc.

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

2 participants