Add the offline-app, webapp-manage permissions to pre-installed apps.

RESOLVED FIXED

Status

()

Core
General
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: vingtetun, Assigned: vingtetun)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

Created attachment 581540 [details] [diff] [review]
Add offline-app, webapp-manage permissions to pre-installed app
Attachment #581540 - Flags: review?(jones.chris.g)
Comment on attachment 581540 [details] [diff] [review]
Add offline-app, webapp-manage permissions to pre-installed app

>diff --git a/b2g/chrome/content/shell.js b/b2g/chrome/content/shell.js

>+// XXX until we have a security model, add some rights to
>+// the pre-installed web applications 
>+function addPermissions(urls) {
>+  let permissions = ['indexedDB', 'webapps-manage', 'offline-app'];

Giving all app "webapps-manage" really sucks, but I understand why
you're doing it.  Instead of an XXX here, let's find a bug to link
here with a FIXME comment, or push on Jonas/WebAPI team to file one.

>@@ -251,10 +258,18 @@ var shell = {
>             return;
> 
>           let documentURI = contentWindow.document.documentURIObject;
>-          let manifestURI = Services.io.newURI(manifest, null, documentURI);
>+          if (!Services.perms.testPermission(documentURI, 'offline-app')) {
>+            if (Services.prefs.getBoolPref('browser.offline-apps.notify')) {
>+              // TODO Add code to handle the notification UI

"FIXME/bug XXXXXX: [blah]"

r=me with those fixes.
Attachment #581540 - Flags: review?(jones.chris.g) → review+
Assignee: nobody → 21
Blocks: 709468
Created attachment 581654 [details] [diff] [review]
Patch for check-in
Created attachment 581727 [details] [diff] [review]
Patch for check-in
Attachment #581654 - Attachment is obsolete: true
http://hg.mozilla.org/mozilla-central/rev/fe5bd75f1553
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.