Skip to content

Instantly share code, notes, and snippets.

@jnovack
Last active June 14, 2020 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnovack/77aea1c0210bf6e082ef719ce10b71f8 to your computer and use it in GitHub Desktop.
Save jnovack/77aea1c0210bf6e082ef719ce10b71f8 to your computer and use it in GitHub Desktop.
Chrome Test for SSH Extension
var detect=function(base,if_installed,if_not_installed){
var s=document.createElement("script");
s.onerror=if_not_installed,s.onload=if_installed,document.body.appendChild(s),s.src=base+"/html/nassh.html"
};
detect("chrome-extension://pnhechapfaindjhompbnflcldabbghjo",
function(){
console.log("Yes");
},
function(){
console.log("No");
}
);
detect("chrome-extension://pnhechapfaindjhompbnflcldabbghjo",
function(){
console.log("<a href='chrome-extension://pnhechapfaindjhompbnflcldabbghjo/html/nassh.html#username@hostname'>SSH to Host</a>");
},
function(){
console.log("<a href='https://chrome.google.com/webstore/detail/secure-shell/pnhechapfaindjhompbnflcldabbghjo'>Download Extension</a>");
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment