androidgoogle-chrome-appchrome-app-developer-tool

Chrome Apps Developer Tool cca says background, fullscreen permissions not supported


The background permission is very important. Without it, how do you create the window?

chrome.app.window.create(...)

I have an app with the following manifest:

{
    "manifest_version": 2,
    "name": "MyApp",
    "description": "MyApp",
    "version": "0.7",
    "minimum_chrome_version": "27",
    "offline_enabled": true,
    "options_page": "options.html",
    "icons": 
    {
        "16": "images/icon16.png",
        "48": "images/icon48.png",
        "128": "images/icon128.png"
    },
    "app": 
    {
        "background": 
        {
            "scripts": 
            [
                "scripts/messaging.js",
                "scripts/utils.js",
                "scripts/database.js",
                "scripts/fs.js",
                "scripts/background.js"
            ]
        }
    },
    "permissions": 
    [
        "unlimitedStorage",
        "fullscreen",
                {
            "fileSystem": 
            [
                "write"
            ]
        },
        "background",
        "<all_urls>"
    ],
    "update_url": "http://192.168.1.101/chrome/crx/updates/MyApp2.xml"
}

This app shows as full screen. The database and file handling, as well as the creating of the user's window is all handled by background.js which runs in the background. In a regular Chrome App when I've tried to add some of those functions (for example, chrome.app.window.create(...) which is what creates the client window), the runtime has thrown an error saying those functions/objects don't exist in the front end. So, without background permission, how do I do those things?


Solution

  • First, some naming clarifications:

    I believe your question is: "I have a Chrome App which runs on Desktop Chrome, and it uses the "background" and "fullscreen" permissions. When I use cca to create a port for Mobile, cca complains that the permissions are not recognized."

    Well, the good news is that all cca apps are always "fullscreen" and "background". The warning message is just because v2 Chrome Packaged Apps don't require those permissions, and so we missed adding them to our whitelist of accepted permissions.

    The warnings, in this case, are safe to ignore (though I'm not sure if there exists a fullscreen API, that likely won't work). Those warnings are useful when you require a permission we really do not support yet, say, like "bluetooth".

    So I guess my question is: did you try moving on to the next step to see if it worked?

    Edit: With the latest release of cca to npm (v 0.0.11) we should not show warnings if your app requests these permissions.