Issue using window.postMessage in Firefox OS privileged app - firefox-os

We are developing an HTML5 gaming platform which we want to port to Firefox OS as a packaged app. We have a social feature that integrates with Facebook and defining the redirects, origin and "type": "privileged" in the app manifest works for us. However, we faced another problem. The games are loaded in an iframe and the communication mechanism that we use to send messages between the games and the platform is window.postMessage, which is blocked when we set the "type": "privileged" in the app manifest (tested on Firefox OS Simulator 1.2 and 1.3). We are aware that this must be due to a security restriction, but is there a way to surpass it?
Any advice will be greatly appreciated.
Thank you.

Related

Chrome Extension Native Messaging with same extension installed across multiple chrome profiles

This feels like a shot in the dark but...
Should a single Native Messaging host be able to communicate with the same extension installed on multiple chrome profiles?
I'm working on an extension which is installed to both my personal and work profiles. But it seems that the Native Messaging host only sends messages to the most recently connected instance of the extension.
I don't believe this is addressed in the Native Messaging documentation and I've run out of search ideas, thanks in advance for any help!
When nativeMessaging API is used it starts an instance of native app each time a connection is created by the extension so such an instance can communicate with its "parent" extension only. Consequently, there should be no problem.
In case you want to use chrome.runtime.onConnectNative to do the reverse (to connect from a native app to an extension which will work even when Chrome is closed) see crbug.com/967262 for more info or create a new issue there asking for details. Judging by the bits I see this feature is available only on ChromeOS and it's even disabled by default.

Chrome extension accessing UWP app?

We have chrome and FF extensions which works with a native messaging app. Recently we developed edge extension and a UWP app which works in the same way. Now the user has to install two separate native messaging apps if they want use any chrome/FF/Edge browsers.
My question is, is it possible for Chrome/FF extension talk to windows UWP app?
Unfortunately no. On Windows, both Chrome and Firefox use the registry to locate the native applications manifest, and Windows Store apps are forbidden from writing to the registry. (ref: Prepare to package an app (Desktop Bridge)
If something changes (Store apps gain the ability to alter the registry, or Chrome and Firefox introduce an alternative way to locate the manifest), then it might be possible. Though likely not via the UWP app directly. UWP apps appear to support standard input and output, but the way they are run prevents access to it. It might however be possible to create an intermediary Win32 app that can communicate with the UWP app via the AppService and the browser extension via stdio.
Afterthought: Enpass Password Manager (win32) was ported to the Windows Store reportedly because of API issues, and has a browser extension for Chrome and Firefox. Might be worth asking them how they pulled it off. I did some more digging, and figured it out. localhost loopback, a custom url scheme, web sockets, and browser verifications is how they are doing it. Not an ideal solution, but it seems to work.

Chrome extension - Get network information

I'm trying to "read" all wireless networks through my Chrome Extension.
I found this source which answer my question: https://developer.chrome.com/extensions/networking_config
BUT in the top of the page is written:
Important: This API works only on Chrome OS.
It is a little bit confusing.. I'm using Chrome browser on a windows 8.1 platform. Is this API action will work or not?
I'm confused because of this wiki quote:
Chrome OS is an operating system designed by Google that is based on the Linux kernel and uses the Google Chrome web browser as its principal user interface.
Source: https://en.wikipedia.org/wiki/Chrome_OS
By Wiki, the answer is Yes, each chrome browser is based on Chrome OS system so the API will work.
Please advice, Thank you in advance!
Lior.
Your understanding is not exactly correct, this api will only work on Chrome OS.
The following words means Chrome OS uses chrome browser as its principal user interface, rather than "each chrome browser is based on Chrome OS".
Chrome OS is an operating system designed by Google that is based on the Linux kernel and uses the Google Chrome web browser as its principal user interface.

How to certify Firefox OS 1.4 app?

I am developing Firefox OS 1.4 app. It is just a basic app. All it does is fetch file from SD card.
But the problem is only certified app can have this authority. And I am planing to make more such type of apps in future. So the problem is every time my app will not run because it is not a certified app.
Now I googled a lot to find how to certify Firefox OS 1.4 app. While searching on this site I found only one question similar to my question.
According to first answer I have mainfest.webapp including "type": "certified". And then I zipped all files (not folder). I have following files:
mainfest.webapp
index.html
MyJavaScript.js
But I do not know what is webapps.json file and how to add "appstatus": 3 to it.
I have ordered real Firefox OS 1.4 phone from flipkart (it is not yet come) and I want to run my apps on my real Firefox OS 1.4 phone. All I want to do is certify my app so that it can be authorized to do secure tasks. Please help me and tell me the way I can certify my Firefox OS 1.4 apps.
Certified app is generally an internal app and it comes along with the device. Third party developers cannot create or distribute such apps. I think you are trying to develop a privileged app. Privileged app can access the sdcard upon user prompt. Mention the app type as privileged in manifest file and submit the app to the Firefox OS marketplace for code review if you wish to distribute it through marketplace.

chromecast on chrome packaged app

I would like to add the ability to cast my chrome packaged app to a google chromecast device.
So far google states that all you have to do is add
to your page and the API will inject itself.
For me that doesn't happen. No code is injected.
Am I doing something wrong?
There doesn't seem to be a demo showing this type of capability.
EDIT:
I just wanted to clarify a bit. All that I would like to do is display my app to a screen.
I have no media. I simply want to display it exactly as the chrome extension in the chrome browser would.Therefore I would follow the directions for a sender only. The app is packaged so it is running only CSS/JS/HTML5 code. The app is designed to run offline.
Steps I've taken to cast:
1. I've added the extra bit to the HTML line:
2. I've followed the whitelisting, to the best of my understanding, by adding my "website address" to the chrome extension. So I've added the only two address that should matter.
127.0.0.1
192.168.1.106
There is a good chance Content Security Policy is blocking the implementation of the cast API being injected. I see that you've filed Issue 287254: Google cast (chromecast) ability for packaged apps, and suspect we will need to wait for it to be implemented in a packaged apps compliant way.
You must whitelist your device and your Chrome app. See here for more details:
https://developers.google.com/cast/whitelisting#whitelist-chrome

Resources