I am creating a web extension using javascript and I need to get the SSL certificate of the website my extension is running on.
I first did it using NodeJs module openssl-cert-tools.
It works when I do it in the NodeJs console.
Then I ran the browerify command to include NodeJs modules in the javascript. But it doesn't work in the web browser.
Does someone have the solution ?
Thanks!
I don't think you'll be able to use openssl-cert-tools, as it requires the node runtime. You might look into using a different tool-set, such as forge which might allow you to do what you're looking to do.
Related
I am interested to develop hbbtv apps and I am desperate to know how to run and test an full hbbtv application package, in this context a videoplayer having multiple html pages , using Firefox's plugin FireHBBTV. I have pretty much searched for it all over Net but couldn't find one!
You have to install an http server to serve a files, then it's opening from url address. If you are trying to open first time you can open http://itv.mit-xperts.com/hbbtvtest/ which is like demo page of hbbtv features (not all could work).
I need your help regarding node.js. I just finished a course and I want to run my code on a web hosting.
The problem is, that when I upload it per ftp, I won't see it as website (even though it has html tags in it) but as code. Is it because the web hosting isn't compatible with node.js? Or is there anything I should do beside requiring express?
Is there anything I should install or do?
The code works totally fine if I go through localhost.
Thank you a lot in advance!
TheGabornator
Is it because the web hosting isn't compatible with node.js?
Yes.
Is there anything I should install or do?
If your only access to the host is via FTP or some web based UI, then you almost certainly need to change host. You're unlikely to have a host which lets you run Node.JS applications unless they offer you full shell access.
You need either a host which explicitly supports Node.JS or one which gives you full shell access and allows you to install software (such as a virtual machine or dedicated server).
I want to write an Extension for the google chrome browser which reads some links from a website and copy these links into a file. I want to send this file via ssh to another computer in my local network.
How can I setup and use a ssh connection in my chrome extension?
Assuming you mean scp, not ssh, here are your options:
Set up a WebSocket proxy. Write JavaScript to send the XHR-fetched ArrayBuffer. WebSockets can go over SSL, so you'll probably be satisfied with that rather than implementing SSH in JavaScript (and then scp over that).
Same idea but an HTTP proxy. This would be pretty painful. See Web-based SSH for overview.
Write a Chrome App, thereby getting access to chrome.sockets. Implement SSH in JavaScript. See paramikojs to get started.
Chrome App, Native Client. This can actually work; see Secure Shell. Add scp functionality.
The Chrome-App-based solutions raise a separate question of how to get the web content. You might be able to use Chrome Apps webview. Or you can message the content between the app and a Chrome Extension.
There are probably other approaches as well. But you get the idea: you have a lot of coding ahead of you.
I am using native messaging API in Chrome extension, and I want to ship the native application within my extension.
In Windows, I add a registry key under HKLM\SOFTWARE\Google\Chrome\NativeMessagingHosts. Since my application is inside the extension folder after installed, I reference the full path by "%LOCALAPPDATA%\Google\Chrome\User Data\Default\Extensions\...\....json". But in this way, my extension complains "Specified native messaging host not found.".
If I expand the %LOCALAPPDATA% and write the path as "C:\Users\...\AppData\Local\Google\Chrome\User Data\Default\Extensions\...\....json", then my extension can successfully communicate with the host.
I wonder if this is an intended behavior? Thank you for your help.
There is no expansion of environment variables in the current Chromium code. It sounds like a reasonable feature request, though there might be security reasons not to do it. If you file a bug, we'll have a look and see whether it's feasible.
I'm developing a phonegap app for android and I need to be able to run the app on chrome. My app doesn't have any phone functionality yet. Is all Javascript, HTML and CSS.
The problem is I'm fetching some info of my server but I'm having trouble debbuging the javascript, so I wanted to test te app on the browser so I can use the developer tools, but the ajax call wont work on Chrome (It does on the phone).
Any ideas?
You need to run Chrome with the flag --disable-web-security. You can either run chrome.exe --disable-web-security from the command line (in the appropriate directory) or edit the shortcut and add it. (Assuming you're on Windows)
If running in chrome is for testing only, jprofit's solution should be good enough. However, if users need to run it, they won't start chrome with those options :) In that case, you have two solutions
Use JSONP ans script tags (this could be a lot of work and error handling is poor)
Route your calls through a proxy on the local server http://developer.yahoo.com/javascript/howto-proxy.html, http://www.daniweb.com/web-development/php/code/216729
The simplest solution for me has been to use a proxy (as #juan-mendes suggests).
I use a tiny NodeJS server called Sleight, which runs locally ( http://phonegap.com/2010/01/20/introducing-sleight/ ).