Closed Bug 931409 Opened 11 years ago Closed 6 years ago

After reboot, packaged app (not of type "certified" or "privileged") is restricted by CSP

Categories

(Firefox OS Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: wolfcda, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0 (Beta/Release)
Build ID: 20130910160258

Steps to reproduce:

I packaged my app as described here under "Self-publishing packaged apps" https://developer.mozilla.org/en-US/Apps/Developing/Packaged_apps?redirectlocale=en-US&redirectslug=Web%2FApps%2FPackaged_apps

The app itself makes use of some functions (like 'eval', 'Function()', etc.) that a privileged or certified app would not be able to run, as described here: https://developer.mozilla.org/en-US/Apps/CSP - however, since the app doesn't need any privileges, it runs as type "web".

I installed the app successfully from my self-hosted page.  It ran fine when I launched it.  Then I rebooted the phone, then launched again, when the problem occurred.

I'm running Firefox OS 1.1.1.0-prerelease on my Geeksphone Keon, but the problem also happens in the Firefox OS Simulator (turn simulator off, then on again, and I get the same issue.  Simulator says it's running 1.1.0.0-prerelease).


Actual results:

After rebooting the phone, I received an error (I have some code in a try-catch block so I can see what Exception I'm getting) saying "Error: call to Function() blocked by CSP".


Expected results:

Since the app is not privileged or certified - and ran the first time after installation - it should run fine after reboot.  Instead, it seems Firefox OS is treating it as privileged or certified after rebooting?
I should note that I found this error when testing my app on my Keon phone after "Push"-ing the package to it via the Firefox OS Simulator - where it would similarly run correctly - then after rebooting the app wouldn't run correctly at all, which led me to test as above too.

I'm not sure if it would affect apps distributed via the Firefox Marketplace too, but it's concerning me since my app is there too (I can't install it on my phone, as it's a paid app and Canada isn't supported yet for payment options!).

Thanks for your help...
Also tested just now with 1.2.0.0-prerelease (from http://downloads.geeksphone.com (v1.2-Oct-25)): same issue occurs after a reboot.
I hadn't seen any more on this, and decided to do some more exploring on this issue.  I have written small test-app that demonstrates the issue, plus I have some more information on how to reproduce it.

On a Firefox OS phone, go to http://cyberdog.ca/bug/ to install the package (and also view the mini-manifest and ZIP).

The manifest in the ZIP file itself *does* have a 'csp' directive, one which - if I was reading the syntax correctly, should allow an external link to open in-app properly. However, there is no 'type' directive, so the app *should* still run as 'web' (the default).

Installing the package above and running it will work - you'll see a simple "snow" animation, and be able to click on the "External Link".  Restarting the phone and then running the app again will break (the "snow" animation won't start).  If you remove the 'csp' directive from the package manifest, it runs fine.

So... maybe it's more a problem with my understanding of the 'csp' rules than a bug with the OS, but the behavior still seems wrong (ie. the app should behave the same way both before and after restarting the phone).

I hope that helps those maintaining the OS to track down the problem?

Thanks...
Firefox OS is not being worked on
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.