Remote control a Chrome Extension - google-chrome-extension

I've written a non-published (personal) Chrome extension that performs page checking and then performs actions such as opening new tabs if certain conditions are met. I would like to be able to "remote control" it from my phone though, e.g. turn on or off or adjust settings when I'm away from my desk.
I considered if the extension can read/write to a file in Dropbox, which I could then edit from my phone too, or any other device. But I'm not sure if extensions are allowed to arbitrarily read/write in the filesystem, or only "apps". Any other suggestions?

Assuming you can't directly connect to your computer (otherwise wOxxOm's answer is valid)..
You could make a companion phone app and use GCM push messages; your phone would message your server via it (which can be hosted on a free App Engine tier easily if it's just for your private use) and the server will push out the message.
Though it'll probably be much easier to just have said App Engine server up and providing a WebSocket endpoint that your extension can connect to to receive commands in real-time, and some sort of API / control panel on the web (authenticated, of course).

Any free webserver-based solution would lag, as bad as 500ms, I think.
Try making a complementary native PC program: mobile apps for remote control usually have their PC part running as a background service or an application with just a shelltray icon. Such program opens a TCP/UDP port on PC and listens for commands from the mobile app, and can communicate with your extension via Chrome's native messaging API.

Related

How to allow Google Chrome to access your microphone forever on local server?

I've created my LocalHost using Node.js to test and debug my javascript project.
I'm Using Chrome.
On HTTPS server I need to click allow using mic just the first time, but in my localhost, I need to click on allow pup op each time my project calls microphone.
How do I allow access to my microphone on my localhost once?
If there is not a way to achieve that do you know any free https hosting fo testing purposes...
You need a secure connection in order for Chrome to remember your permission preference. You should be able to create a self-signed cert (the instructions differ based on the OS) so that you can actually visit localhost securely, once you've done that your microphone will be accessible between page loads.

Can i use Chromecast as a server?

Studying the possibility to achieve the following:
We have a CMS that from time to time posts to a web hook a media URL (video) (public internet hosted)
This web hook post we would like to post directly to a ChromeCast which is plugged in to a TV
Questions:
1. Can a web server like nodeJS be installed on a chrome cast?
2. Is it possible to use for example DynamicDNS to link the Chromecast to a domain name so the post from the web hook can be made?
ChromeCast has a sender API which allows you to "send" content to a specific Chromecast. Right now, the sender API works on Android, IOS and Chrome OS. You can read more about it here: https://developers.google.com/cast/docs/sender_apps.
And, here's how a receiver application that would receive your content on the ChromeCast would work: https://developers.google.com/cast/docs/receiver_apps or if you're content is a standard type, then you can use a prebuilt receiver application without building your own.
To answer your specific questions:
Can a web server like nodeJS be installed on a chrome cast?
No, not without enormous hacking and development yourself to basically take over the hardware somehow and get your own stuff to run on it.
Is it possible to use for example DynamicDNS to link the Chromecast to
a domain name so the post from the web hook can be made?
Not that I know of.
The chromecast has an android like google chrome operating system. It is possible to root it, but you will not be able to (to my knowledge) get a server on it. I would suggest taking a look at the Raspberry Pi. You should be able to run a slim server on it. After you get that set up it might be feasible to pass command line commands to chrome or another web browser to display the data you like. A browser is not necessary, but I'm not sure if you know of any other way to display the media.
A different approach would be to have a server anywhere (could be in your home) and have something like the raspberry pi (any computer for displaying the content) connect to a webpage hosted with that server. Using websockets something like socket.io, you could set it up so that the server could send messages (url of video) to the browser session you have open. The javascript of your webpage would then use that message to open that url.

WebRTC Streaming between PC and Mobile Client

I would like to implement peer to peer communication between mobile device (iOS & Android) AND Windows PC, I would like Mobile app will stream camera output to PC(no audio will require), and on PC user will able to capture screenshot from running steam. Below is possibility I am thinking.
Option 1 : Develop a Web based application which will run in Google Chrome or Firefox browser on Windows PC, and also will develop mobile client app which will run on Android and iOS devices, and using WebRTC it will steam mobile camera output to website which will be running in PC’s Chrome or Safari browser, and User will able to capture screenshot from running steam and that will be saved on user’s computer. Drawback of this solution is that I have to develop Website so will have not user’s computer file storage, as standalone desktop application is more preferable because desktop application will able to easily access user’s computer file system
Option 2: Develop 3 applications
one Standalone desktop application which will have all features which require to access computer’s local file system.
Develop a small web site which will have just a single screen, it will use for display mobile camera steam, and user will capture output from that page, will develop a kind of watchdog service in desktop app, which will grab latest captured screen from Chrome or Firefox browser.
3rd app would be mobile client which will be running on mobile which will stream camera output to PC using WebRTC. Drawback of this solution is that this solution would be not real-time, because user have to use two separate interface for Screen capture have to use PC Chrome or Firefox browser, and after screen capture have to move back to PC application.
My understanding is that It’s not possible to have Server less solution for WebRTC, Signaling server will require, I found some of open source WebRTC servers i.e. Easyrtc, signalmaster which I have to use and have to configure in own environment.
As this is my first WebRTC based project, so would like to know your opinion about Solution which i am thinking, is it right or is there any better way to achieve it.
Thanks
Suresh
Hi suresh IOS not support WebRTC,But its possible in android
My option is Node-webkit(desktop app using HTML 5,Javascript,css3,Nodejs,NPM)
https://github.com/rogerwang/node-webkit/wiki
mobile app(intel xdk ) but ios not support WebRTC
http://xdk-software.intel.com/
You could use Twilio Video to do this.
You can build multi-party video calling into both web and native applications with the SDKs for:
JavaScript
iOS
Android
https://www.twilio.com/docs/api/video
You will also find the server-side starter apps in various languages you need to get started quickly.
In my preferred language example Python, a small Flask app handles token creation to handle user access for video conversations in app.py and the basic WebRTC functions can be found in quickstart.js.
Note: I work for Twilio.

How can I launch a program from a Web Page?

I simply want to OPEN a program in my pc from a web page. For example, I am out and I take my smartphone, I go to the web page and then I click in a button and in my pc (at home, connected to internet) the program starts. How can I do that?
I tried: Open File
but the browsers (Firefox, Internet Explorer) try to download this file and not open.
Web browsers are incapable of running files on a remote machine, purely out of security reasons, because it could obviously do serious harm. This is only doable if you try to run a file on the machine you are using to visit the website with. There are applications available that can open files on or from a remote machine, but they tend to use a TCP or UDP connection to transfer the data, instead of an HTTP connection.
The best way to go about this, is to install a server application on your PC, and then connect to the PC with a client application on your smartphone.
Just search google for Remote control smartphone pc, or something similar.
You cannot do this using a web page. You must use a VNC. There are many open source versions with mobile client apps.

App for Google Chrome

I have created an App for google chrome which just opens a web page. I am new in the topic
of Apps. I was thinking if it is possible to execute some linux command by using an App
in google chrome. For instance, an App which can open a terminal or open a program
installed in my machine like Gimp, Kate, Libre Office ...
From the instructions in the web page of google I saw that the only actions for an App
are limited to open a web address but I dont know if it is possible to extend the capabilities
of the Apps,
Regards.
Aren't apps sandboxed into the Google Chrome Process to ensure they can't affect other processes and for other security reasons. If so, you won't be able to execute programs/commands or view the User's Files unless you use some workaround such as Google's Native Client.
Google has locked down capabilities to stop malicious Web Apps from executing code and bringing malware and exploits.
You can write a NPAPI Plugin or a custom URI scheme associated to Unix terminal.

Resources