feat: add Firefox extension support
- Add Firefox as an install target with native messaging manifest support. - Generate Firefox-specific extension packages with Gecko metadata and AMO-compatible manifest transforms. - Keep tab group commands available in Firefox through dynamic tab group API helpers. - Avoid Firefox linter warnings for static tab group API references and direct eval tokens. - Add Firefox packaging and installer regression coverage. - Bump the package and extension version to 0.15.1.
This commit is contained in:
+26
-1
@@ -87,7 +87,7 @@ def test_install_help_lists_supported_browsers():
|
||||
result = CliRunner().invoke(main, ["install", "--help"])
|
||||
|
||||
assert result.exit_code == 0
|
||||
assert "[chrome|chromium|brave|edge|vivaldi]" in result.output
|
||||
assert "[chrome|chromium|brave|edge|vivaldi|firefox]" in result.output
|
||||
|
||||
def test_install_writes_testing_and_webstore_allowed_origins(tmp_path):
|
||||
manifests = []
|
||||
@@ -117,6 +117,31 @@ def test_install_writes_testing_and_webstore_allowed_origins(tmp_path):
|
||||
assert "Testing extension ID" in result.output
|
||||
assert "Chrome Web Store extension ID" in result.output
|
||||
|
||||
def test_install_writes_firefox_allowed_extensions(tmp_path):
|
||||
manifests = []
|
||||
|
||||
def fake_install_manifest(_browser, _host_exe, manifest):
|
||||
manifests.append(manifest)
|
||||
return [tmp_path / "com.browsercli.host.json"]
|
||||
|
||||
with patch("browser_cli.commands.install.native_host_exe", return_value=tmp_path / "browser-cli-native-host"), patch(
|
||||
"browser_cli.commands.install.write_native_host_exe"
|
||||
), patch("browser_cli.commands.install._install_manifest", side_effect=fake_install_manifest):
|
||||
result = CliRunner().invoke(main, ["install", "firefox"])
|
||||
|
||||
assert result.exit_code == 0
|
||||
assert manifests == [
|
||||
{
|
||||
"name": "com.browsercli.host",
|
||||
"description": "browser-cli native messaging host",
|
||||
"path": str(tmp_path / "browser-cli-native-host"),
|
||||
"type": "stdio",
|
||||
"allowed_extensions": ["browser-cli@yiprawr.dev"],
|
||||
}
|
||||
]
|
||||
assert "about:debugging#/runtime/this-firefox" in result.output
|
||||
assert "Firefox extension ID" in result.output
|
||||
|
||||
def test_install_windows_registers_native_host(tmp_path):
|
||||
writes = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user