KOrrosh Sh
KOrrosh Sh

Reputation: 134

Firefox OS:processes, memory

I am developing an application for the Firefox OS which is going to kill the applications which uses a lot of power of the mobile phone, I could find out the information about battery by using Battery API. So my question is

How to extract information about the processes which are running on the Firefox-OS?

Upvotes: 1

Views: 104

Answers (1)

Applications in Firefox OS are just iframes, so you can get the list of running processes by switching to the right window context and doing

var apps = document.getElementsByTagName('iframe');
apps.forEach(function(app) {
  console.log(app.src);  // Print out the app origin.
});

That being said, only apps with elevated privileges are allowed to execute code in the context you need. You can read more about certified apps here https://developer.mozilla.org/en-US/Marketplace/Publishing/Packaged_apps, but the short story is that certified apps are not distributed through the normal marketplace.

Hope that helps!

Upvotes: 1

Related Questions