Skip to content

Instantly share code, notes, and snippets.

@qwe2
Last active August 29, 2015 14:16
Show Gist options
  • Save qwe2/de5d46e3d0b84228b8ca to your computer and use it in GitHub Desktop.
Save qwe2/de5d46e3d0b84228b8ca to your computer and use it in GitHub Desktop.
CloudSharper local component starter for Chrome on Windows
  • Run the .reg replacing the path of lc_manifest.json
  • Put mainfest.json and cs_local_component.js in the same folder
  • Make a Chrome extension out of that folder
  • Configure lc_manifest.json with the right path to the local component
  • Replace %EXTENSION_ID% with the real id of the Chrome extension in lc_manifest.json
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Google\Chrome\NativeMessagingHosts\com.cloudsharper.local_component]
@="C:\\Path\\to\\lc_manifest.json"
chrome.webNavigation.onBeforeNavigate.addListener(function(details) {
var port = chrome.runtime.connectNative('com.cloudsharper.local_component');
}, {
url: [{
urlMatches: 'cloudsharper\.com\/(work|create)'
}],
});
{
"name": "com.cloudsharper.local_component",
"description": "CloudSharper Local Component",
"path": "path/to/CloudSharper.Console.exe",
"type": "stdio",
"allowed_origins": [
"chrome-extension://%EXTENSION_ID%/"
]
}
{
"manifest_version": 2,
"name": "CloudSharper local component starter",
"description": "This extension starts the CloudSharper local component",
"version": "0.1",
"permissions": [
"nativeMessaging",
"webNavigation",
"*://*/*"
],
"background": {
"scripts": ["cs_local_component.js"],
"persistent": false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment