{"id":34199618,"url":"https://github.com/clear-code/mcd-go","last_synced_at":"2026-03-13T04:33:47.984Z","repository":{"id":137338195,"uuid":"99094720","full_name":"clear-code/mcd-go","owner":"clear-code","description":"A library to read values from MCD (Mission Control Desktop) configuration files for Firefox addons","archived":false,"fork":false,"pushed_at":"2020-06-11T15:34:06.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-12-18T20:06:20.246Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clear-code.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-08-02T08:56:11.000Z","updated_at":"2018-04-12T03:23:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"114955d6-8dc5-4bd9-9fc2-b19e972b6cba","html_url":"https://github.com/clear-code/mcd-go","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/clear-code/mcd-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clear-code%2Fmcd-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clear-code%2Fmcd-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clear-code%2Fmcd-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clear-code%2Fmcd-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clear-code","download_url":"https://codeload.github.com/clear-code/mcd-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clear-code%2Fmcd-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30458001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T03:55:51.346Z","status":"ssl_error","status_checked_at":"2026-03-13T03:55:33.055Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-15T18:01:05.955Z","updated_at":"2026-03-13T04:33:47.969Z","avatar_url":"https://github.com/clear-code.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mcd-go\n\nA library to read values from [MCD (Mission Control Desktop)](https://developer.mozilla.org/en-US/docs/MCD,_Mission_Control_Desktop_AKA_AutoConfig) configuration files for Firefox addons.\nThis is strongly designed to implement [native messaging host](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_messaging) applications.\n\nThis is a workaround alternative of missing [`storage.managed`](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/storage/managed). See also the [bug 1230802](https://bugzilla.mozilla.org/show_bug.cgi?id=1230802). After the API is landed, you should migrate to it.\n\n## Usage\n\n```go\nimport (\n  \"github.com/clear-code/mcd-go\"\n\n  \"log\"\n  \"encoding/json\"\n  \"github.com/lhside/chrome-go\"\n)\n\ntype ReadConfigsResponse struct {\n  Foo  string `json:\"foo,omitempty\"`\n  Bar  int64  `json:\"bar,omitempty\"`\n  Bazz bool   `json:\"bazz,omitempty\"`\n}\n\nfunc ReadConfigs() {\n  configs, err := mcd.New()\n  if err != nil {\n    log.Fatal(err)\n  }\n\n  response := \u0026ReadConfigsResponse{}\n\n  foo, err := configs.GetStringValue(\"extensions.myaddon@example.com.foo\")\n  if err == nil { response.Foo = foo }\n  bar, err := configs.GetIntegerValue(\"extensions.myaddon@example.com.bar\")\n  if err == nil { response.Bar = bar }\n  bazz, err := configs.GetBooleanValue(\"extensions.myaddon@example.com.bazz\")\n  if err == nil { response.Bazz = bazz }\n\n  body, err := json.Marshal(response)\n  if err != nil {\n    log.Fatal(err)\n  }\n  err = chrome.Post(body, os.Stdout)\n  if err != nil {\n    log.Fatal(err)\n  }\n}\n```\n\n## Restrictions\n\n * This just loads the first `*.cfg` file under the Firefox's directory.\n   * If there are multiple files, others are simply ignored even if one of them is actually used.\n   * Even if the `*.cfg` file is not used, this always loads it.\n * This just loads the `failover.jsc` file in the default Firefox profile placed under `%AppData%\\Mozilla\\Profiles\\*.default`, as the remote configuration file. In other words, this doesn't fetch actual remote configuration file specified via `autoadmin.global_config_url`.\n   * If you actually use different profile, this doesn't detect it.\n * Loaded configuration files are parsed in a sandbox.\n   * Only limited directives are available.\n   * User values in the profile are not accessible.\n   * `Components.utils.import()` and other internal features don't work. If your configuration file depends on such internal technologies, this cannot load values correctly.\n\n## License\n\nMPL 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclear-code%2Fmcd-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclear-code%2Fmcd-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclear-code%2Fmcd-go/lists"}