Google Cloud Messaging (GCM) is a service that enables developers to send data from servers to both Android applications or Chrome apps and extensions.
I am developing a chrome and a firefox extension/add-on. I am using the Web Extension APIs for Firefox extension.
Now, Web Extension APIs don't support chrome.gcm.* APIs yet. Essentially, a firefox extension cannot talk to GCM.
Is there something else like GCM to which a firefox extension can talk to? Something provided by the Firefox just like GCM provided by Google for its browser Chrome? If not, can someone please explain how to achieve this in a Firefox Extension?
Update:
Even for web apps, firefox doesn't use something similar to GCM. They use service workers. Can Firefox Browser Extensions interact with service workers?
Firefox extensions currently can’t use service workers directly (according to an implementor who worked on service-workers support in Firefox).
Is there something else like GCM to which a firefox extension can talk to? Something provided by the Firefox just like GCM provided by Google for its browser Chrome?
Yes, there’s a Firefox equivalent of GCM. Firefox users receive push notifications from a server given by the dom.push.serverURL user preference. If you check dom.push.serverURL in about:config, you’ll see wss://push.services.mozilla.com/, which is the Mozilla Push Service—essentially, Mozilla’s equivalent of GCM.
That runs an AutoPush (Python-based open-source Push Server software project) backend, and the client part is (as the question notes) exposed to frontend code by a service worker.
So while there may be an alternative way Firefox extensions can connect with Mozilla Push Service, the only publicly-documented way is through the standard Web Push API that relies on service workers, which are not available yet for use in Firefox extensions.
Related
I need to have a communication channel between my web application that runs on Chrome, and a native code on Windows. I need to run a native code when JS requests and pass the results back from native code. The environment is totally managed so I can set trusts and group policies, etc.
I can think of preparing a small web service that runs locally (and allows CORS) and call this service from javascript, but in this case i need to run this code forever.
Any advices will be very helpful. If it is possible i can try Windows registry write/read, pipes, shared memory, MMF or any other way to do it.
Thanks
There's a way to communicate with local processes without using an extension. Websockets aren't restricted to communicating with the same domain as the web page, they can communicate with a WebSocket server on localhost. You have to wrap your native code in a WebSocket server, libraries are available for that though.
Another method is Native Messaging, but it requires a browser extension:
Native messaging enables a WebExtension to exchange messages with a
native application installed on the user's computer.
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_messaging
https://developer.chrome.com/extensions/nativeMessaging
WhatsApp just announced a new web application see here.
For some reason, the interface requires the phone to be connected all the time. Is it for performance reasons (not to create additional load on their current servers)? Is there any other constraint that cause that?
The official explanation:
Your session on WhatsApp Web is an extension of WhatsApp on your
phone. WhatsApp Web connects to your phone to sync messages, thus you
can see all messages on both devices. Thus, the first requirement to
being able to use WhatsApp Web is an active WhatsApp account on your
smartphone.
Source: https://www.whatsapp.com/faq/en/web/28080002
As you may know your Whatsapp history is only being stored in a database on the phone itself. To see that history in your web browser, it needs to get it from the phone. Whatsapp could have redesigned it, so that everything is stored in the cloud (as many competing messaging apps do). But that seems to be against their philosophy. They keep it tighly coupled to a (one) phone. As you may know you cannot install Whatsapp on multiple phones using the same account. The web interface is just a remote for Whatsapp running on your phone.
And even though I don't know for sure, I think it's more secure too. It wouldn't surprise me if the data that's sent between the web app and the phone is encrypted in a way that even Whatsapp themselves cannot decrypt. Maybe the QR code is generated client-side (in the browser) and by scanning it using the app there is no need to exchange the keys through Whatsapp's servers. That way they don't ever get the encryption keys and will not be able to inspect the data that gets routed through their servers.
Note: Of course Whatsapp could at any time change their implementation of both the app or the web app and enable eavesdropping.
I can't find any documentation on what type of internal server PhoneGap is running on mobile devices, whether it's Apache, IIS, or some other minified web server. I'd like to know what type of server it is and whether it can be configured to allow external communication to a server, which is rejecting the incoming requests because it doesn't have the CORS support added to it.
We have 3 options
1) Add CORS support to allow AJAX from PhoneGap device to the web servers
2) Configure the PhoneGap web server to act as a proxy
3) Add a plugin, or write a plugin, which allows a native Android function call to allow communication to the web server
If you have any experience with these or advice on which way to go, your help would be much appreciated. Thanks in advance!
There is no internal server. PhoneGap/Cordova creates a base native application with the default view as a webview. A webview is a blank version of a web browser window. There is no web server component to PhoneGap.
We have an application built on top of the Google App Engine. We now need to write a Windows 7 tray application that accesses services provided by our GAE application. This implies that we need to first make an OAuth connection to our application, and we are finding it difficult to locate information about how to accomplish this.
We have already successfully used Google's OAuth2 API .net client to establish a trusted connection from our Windows application to the Google API, but this does not seem to also give us access to the Google App Engine which seems to live in a different part of the ether.
So first, I would like to ask, are we correct in our understanding that Google App Engine only supports OAuth 1.0 and does not support OAuth 2 as the rest of the Google API seems to support?
And second, (assuming the answer to the above is yes) does anyone know of any information or example code where someone has already made a successful OAuth 1.0 connection from a Windows .NET (C#) application to a Google App Engine application? It would be of great help to us to locate such an example.
Google App Engine supports just Oauth 1.0 and it is still an experimental feature.
Having to deal with a .NET C# application I would proceed in this way:
Get the DevDefined OAuth package
Look the ExampleConsumerSite here
Port in C# the relative simple step explained in Java or Python
A bit of a generic question but let's say you have a desktop app that allows a user to connect to a central server and provides functionality like:
Login
Ability to auto-download profile data on login
Download and uploading save files through the app
A web-server (JSP/ASP.NET/PHP/etc) would do lots of work for you especially on the request-serving and threading front, but it seems a bit of a cheat for a desktop app to use HTTP requests like this.
All thoughts welcome. Maybe this should be community wiki?
If you want to leave things open for other possibilities in the future, go with a web server. That way, if you decide to write a web-based version of your desktop app (or an iPhone/Pre/Android application), you don't have to rewrite your socket server. Almost everything can speak HTTP these days.