{"id":49225379,"url":"https://github.com/jfarleyx/chrome-native-messaging-golang","last_synced_at":"2026-04-24T07:00:36.995Z","repository":{"id":57547766,"uuid":"187709363","full_name":"jfarleyx/chrome-native-messaging-golang","owner":"jfarleyx","description":"Chrome extension sample that uses persistent connection (connectNative()) to a native messaging host written in Go.","archived":false,"fork":false,"pushed_at":"2020-04-10T22:25:14.000Z","size":13,"stargazers_count":36,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T15:49:33.389Z","etag":null,"topics":["chrome","chrome-extension","go","golang","native-messaging","native-messaging-host"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jfarleyx.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}},"created_at":"2019-05-20T20:33:16.000Z","updated_at":"2024-05-14T20:40:32.000Z","dependencies_parsed_at":"2022-09-26T18:40:54.830Z","dependency_job_id":null,"html_url":"https://github.com/jfarleyx/chrome-native-messaging-golang","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jfarleyx/chrome-native-messaging-golang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfarleyx%2Fchrome-native-messaging-golang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfarleyx%2Fchrome-native-messaging-golang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfarleyx%2Fchrome-native-messaging-golang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfarleyx%2Fchrome-native-messaging-golang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jfarleyx","download_url":"https://codeload.github.com/jfarleyx/chrome-native-messaging-golang/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfarleyx%2Fchrome-native-messaging-golang/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32212808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T03:15:14.334Z","status":"ssl_error","status_checked_at":"2026-04-24T03:15:11.608Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["chrome","chrome-extension","go","golang","native-messaging","native-messaging-host"],"created_at":"2026-04-24T07:00:36.270Z","updated_at":"2026-04-24T07:00:36.989Z","avatar_url":"https://github.com/jfarleyx.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chrome Native Messaging in Go\n\nSimple Chrome browser extension with a native messaging host written in Go. The focus of this extension and\nnative messaging host is to showcase the creation of a persistent connection using connectNative() to a native messaging host written in Go and exchange JSON formatted messages.\n\n## Getting Started\n\nThe project consists of a Chrome extension app and native messaging host. The native messaging host was written in Go.\n\n### Prerequisites\n\nChrome v74+\n\nGo v1.10+\n\nWindows 10\n\n### Installing\n\nThere are a few steps you must complete to install an unpacked Chrome extension.\n\n**Step 1**: Build the native messaging host exe. Open a terminal and navigate to\nthe \"*native-host/src directory*\" in the project. Then, enter the following\ncommand and hit enter:\n\n```\ngo build -o bin/nativeMsgSample.exe\n```\n\n**Step 2**: Update the `/native-host/config/com.sample.native_msg_golang.json` file. Add the full file path of the *nativeMsgSample.exe* file you just created in step 1 to the \"path\" property value in the JSON file.\n\nExample (change this path to match your file path)...\n```\n{\n    ...\n    \"path\": \"C:\\\\code\\\\github.com\\\\chrome-native-messaging-golang\\\\native-host\\\\src\\\\bin\\\\nativeMsgSample.exe\",\n    ...\n}\n```\n\n**Step 3**: Add required registry key to HKCU. Open the Windows Registry Editor (regedit) and navigate to the following path...\n```\nHKEY_CURRENT_USER/Software/Google/Chrome/NativeMessagingHosts\n```\n- 3.1: Add a new key with title of `com.sample.native_msg_golang` under the *NativeMessagingHosts* key.\n- 3.2: After creating the `com.sample.native_msg_golang` key, there should be a \"*(Default)*\" string value within the key. Right click on that string value and choose \"*Modify*\". Then, enter the full path to `/native-host/config/com.sample.native_msg_golang.json`.\n\n**Step 4**: Install the Chrome extension app.\n\n- 4.1: In Chrome, navigate to `chrome://extensions`.\n- 4.2: Enable developer mode by toggling the switch in the upper-right corner.\n- 4.3: Click on the \"Load unpacked\" button.\n- 4.4: Select the *app* directory in the project to load the html, js, and json files that make up the unpacked extension.\n\n**Step 5**: Run the extension. Open a new tab, and click on the *Apps* button in the Chrome browser toolbar or navigate to `chrome://apps`. Find the \"*Chrome Native Messaging Go Example*\" app and click on it.\n\nYou should see a simple UI containing a button that says \"*Connect to Native host*\". Click that button to establish a connection to the native messaging host.\n\nOnce connected to the native messaging host, a text box and \"Send\" button should appear in the UI. You can enter \"*ping*\" into the text box and hit send. This will send a JSON payload containing \"*ping*\" to the native messaging host. In turn, the host will respond with a JSON payload containing \"*pong*\".\n\n**Debugging host:** To debug the native messaging host launch Chrome with logging enabled. This will open a terminal window when Chrome is started that may contain messages related to Chrome's interaction with the native messaging host. To enable debugging and view its output, append the `--enable-logging` command to a command to launch chrome, like this: `\"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\" --enable-logging`. You can also review the log file the native messaging host will generate. The log file will be found in the same directory as the native messaging host executable.\n\n**Note:** If you do not have a Chrome extension script maintaining a connection to the native messaging host, Chrome will close the Stdin pipe to the host. Depending on how the native messaging host is written, it may or may not close as well. In this sample app, the native host will detect that the Stdin pipe closed and it will trigger the native host to shut down. If the extension is reopened, the native host will start again. I suggest communicating with the native messaging host via a background script. That way, only 1 instance of the native host will be launched.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfarleyx%2Fchrome-native-messaging-golang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjfarleyx%2Fchrome-native-messaging-golang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfarleyx%2Fchrome-native-messaging-golang/lists"}