You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by purplecabbage <gi...@git.apache.org> on 2017/06/14 23:32:44 UTC

[GitHub] cordova-browser pull request #32: Cb 12804

GitHub user purplecabbage opened a pull request:

    https://github.com/apache/cordova-browser/pull/32

    Cb 12804

    ### Platforms affected
    cordova-browser
    
    ### What does this PR do?
    adds manifest.json support
    
    ### What testing has been done on this change?
    added tests
    
    This pr includes all commits from #30 which can be closed.
    
    ### Checklist
    - [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
    - [x] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
    - [x] Added automated test coverage as appropriate for this change.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/purplecabbage/cordova-browser CB-12804

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-browser/pull/32.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #32
    
----
commit eec8c5398440f6fcbbd4e5c1178c46c3d12df688
Author: Audrey So <au...@apache.org>
Date:   2017-05-26T16:38:09Z

    CB-12804 : manifest.json added to browser during create

commit 4a52f045e4beb0d991db613937061757df9638f9
Author: Jesse MacFadyen <pu...@gmail.com>
Date:   2017-06-01T20:21:32Z

    work in progress

commit b85f06ba6a17f8cbd551ef5f827e24384084a72f
Author: Jesse MacFadyen <pu...@gmail.com>
Date:   2017-06-02T18:50:58Z

    Updated images to improve lighthouse score. Added orientation to manifest.

commit 3052805af944a38fa54926393d4f49e49c8cae11
Author: Jesse MacFadyen <pu...@gmail.com>
Date:   2017-06-04T06:51:49Z

    add link rel=manifest, more manifest specs to check

commit 012191c3011076f995f4ec2af8f8729d153fd4e7
Author: Jesse MacFadyen <pu...@gmail.com>
Date:   2017-06-04T07:00:04Z

    remove console.log to stop whining CI

commit 146fb74b69e0c24e56ecff38f0e38aad8353e9fd
Author: Jesse MacFadyen <pu...@gmail.com>
Date:   2017-06-06T18:47:08Z

    remove old xhr-activex windows bs, update to use pagevisibility instead of webkitpagevisibility

commit 5b837270c26d0ee8856ebbf018f516f5998136c9
Author: Jesse MacFadyen <pu...@gmail.com>
Date:   2017-06-07T22:55:11Z

    output create events, copy manifest.json from template to platform_www

commit c4511806452014fd99f5cce6f5ce73614402063a
Author: Jesse MacFadyen <pu...@gmail.com>
Date:   2017-06-09T18:54:09Z

    clean up some cruft, create emit errors, removed old ActiveX seeking xhr code

commit 2e63f9fe43d0e927f9d2ab9cfc2aedd1c2f74f36
Author: Jesse MacFadyen <pu...@gmail.com>
Date:   2017-06-14T23:23:58Z

    run gets start_url from manifest, spec verifies manifest, Api delays writing to manifest and uses platform_www/

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-browser pull request #32: CB-12804 : support manifest.json

Posted by macdonst <gi...@git.apache.org>.
Github user macdonst commented on a diff in the pull request:

    https://github.com/apache/cordova-browser/pull/32#discussion_r122785379
  
    --- Diff: bin/template/www/cordova-sw.js ---
    @@ -0,0 +1,23 @@
    +
    +// Note, these will be updated automatically at build time
    +var CACHE_VERSION = '%CACHE_VERSION%';
    +var CACHE_LIST = ['CACHE_VALUES'];
    +
    +this.addEventListener('install', function(event) {
    +    // Perform install steps
    +    console.log("cordova service worker is installing.");
    +    event.waitUntil(caches.open(CACHE_VERSION)
    +    .then(function(cache) {
    +        return cache.addAll(CACHE_LIST);
    +    }));
    +});
    +
    +this.addEventListener('activate', function(event) {
    +    // Perform activate steps
    +    console.log("cordova service worker is activated.");
    +});
    +
    +this.addEventListener('fetch', function(event) {
    +    console.log("cordova service worker : fetch : " + event.request.url);
    +    event.respondWith(caches.match(event.request));
    --- End diff --
    
    All the examples I've seen from Google program this a bit more defensively:
    
    ```
      event.respondWith(
        caches.match(event.request)
          .then(function(response) {
            // Cache hit - return response
            if (response) {
              return response;
            }
            return fetch(event.request);
          }
        )
      );
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-browser pull request #32: CB-12804 : support manifest.json

Posted by macdonst <gi...@git.apache.org>.
Github user macdonst commented on a diff in the pull request:

    https://github.com/apache/cordova-browser/pull/32#discussion_r122780778
  
    --- Diff: bin/template/cordova/Api.js ---
    @@ -113,52 +110,135 @@ Api.prototype.getPlatformInfo = function () {
             "locations":this.locations,
             "root": this.root,
             "name": this.platform,
    -        "version": { "version" : "1.0.0" },
    +        "version": { "version" : "1.0.0" }, // um, todo!
             "projectConfig": this.config
         };
     };
     
     Api.prototype.prepare = function (cordovaProject,options) {
     
         // First cleanup current config and merge project's one into own
    -    var defaultConfig = path.join(this.locations.platformRootDir,'cordova',
    +    var defaultConfigPath = path.join(this.locations.platformRootDir,'cordova',
                             'defaults.xml');
    -
    -    var ownConfig = this.locations.configXml;
    -
    +    var ownConfigPath = this.locations.configXml;
         var sourceCfg = cordovaProject.projectConfig;
    +
         // If defaults.xml is present, overwrite platform config.xml with it.
         // Otherwise save whatever is there as defaults so it can be
         // restored or copy project config into platform if none exists.
    -    if (fs.existsSync(defaultConfig)) {
    +    if (fs.existsSync(defaultConfigPath)) {
             this.events.emit('verbose', 'Generating config.xml from defaults for platform "' + this.platform + '"');
    -        shell.cp('-f', defaultConfig, ownConfig);
    -    } else if (fs.existsSync(ownConfig)) {
    -        shell.cp('-f', ownConfig, defaultConfig);
    -    } else {
    -        shell.cp('-f', sourceCfg.path, ownConfig);
    +        shell.cp('-f', defaultConfigPath, ownConfigPath);
    +    }
    +    else if (fs.existsSync(ownConfigPath)) {
    +        this.events.emit('verbose', 'Generating defaults.xml from own config.xml for platform "' + this.platform + '"');
    +        shell.cp('-f', ownConfigPath, defaultConfigPath);
    +    }
    +    else {
    +        this.events.emit('verbose', 'case 3"' + this.platform + '"');
    +        shell.cp('-f', sourceCfg.path, ownConfigPath);
         }
     
    -    // this._munger.reapply_global_munge().save_all();
    -
    -    this.config = new ConfigParser(ownConfig);
    +    // merge our configs
    +    this.config = new ConfigParser(ownConfigPath);
         xmlHelpers.mergeXml(cordovaProject.projectConfig.doc.getroot(),
    -        this.config.doc.getroot(), this.platform, true);
    +                        this.config.doc.getroot(),
    +                        this.platform, true);
         this.config.write();
     
    -    /*
    -        "browser": {
    -        "parser_file": "../cordova/metadata/browser_parser",
    -        "handler_file": "../plugman/platforms/browser",
    -        "url": "https://git-wip-us.apache.org/repos/asf?p=cordova-browser.git",
    -        "version": "~4.1.0",
    -        "deprecated": false
    -    }
    -    */
    -
         // Update own www dir with project's www assets and plugins' assets and js-files
         this.parser.update_www(cordovaProject.locations.www);
     
    +    // Copy or Create manifest.json
    +    // todo: move this to a manifest helper module
    +    // output path
    +    var manifestPath = path.join(this.locations.www,'manifest.json');
    +    var srcManifestPath =path.join(cordovaProject.locations.www,'manifest.json');
    +    if(fs.existsSync(srcManifestPath)) {
    +        // just blindly copy it to our output/www
    +        // todo: validate it? ensure all properties we expect exist?
    +        this.events.emit('verbose','copying ' + srcManifestPath + ' => ' + manifestPath);
    +        shell.cp('-f',srcManifestPath,manifestPath);
    +    }
    +    else {
    +        var manifestJson = {
    +            "background_color": "#000",
    --- End diff --
    
    Just wondering if `background_color` default should be white instead. Not opposed to black as it is probably close to 50/50.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-browser pull request #32: CB-12804 : support manifest.json

Posted by purplecabbage <gi...@git.apache.org>.
Github user purplecabbage commented on a diff in the pull request:

    https://github.com/apache/cordova-browser/pull/32#discussion_r124157156
  
    --- Diff: bin/template/cordova/Api.js ---
    @@ -113,52 +110,135 @@ Api.prototype.getPlatformInfo = function () {
             "locations":this.locations,
             "root": this.root,
             "name": this.platform,
    -        "version": { "version" : "1.0.0" },
    +        "version": { "version" : "1.0.0" }, // um, todo!
             "projectConfig": this.config
         };
     };
     
     Api.prototype.prepare = function (cordovaProject,options) {
     
         // First cleanup current config and merge project's one into own
    -    var defaultConfig = path.join(this.locations.platformRootDir,'cordova',
    +    var defaultConfigPath = path.join(this.locations.platformRootDir,'cordova',
                             'defaults.xml');
    -
    -    var ownConfig = this.locations.configXml;
    -
    +    var ownConfigPath = this.locations.configXml;
         var sourceCfg = cordovaProject.projectConfig;
    +
         // If defaults.xml is present, overwrite platform config.xml with it.
         // Otherwise save whatever is there as defaults so it can be
         // restored or copy project config into platform if none exists.
    -    if (fs.existsSync(defaultConfig)) {
    +    if (fs.existsSync(defaultConfigPath)) {
             this.events.emit('verbose', 'Generating config.xml from defaults for platform "' + this.platform + '"');
    -        shell.cp('-f', defaultConfig, ownConfig);
    -    } else if (fs.existsSync(ownConfig)) {
    -        shell.cp('-f', ownConfig, defaultConfig);
    -    } else {
    -        shell.cp('-f', sourceCfg.path, ownConfig);
    +        shell.cp('-f', defaultConfigPath, ownConfigPath);
    +    }
    +    else if (fs.existsSync(ownConfigPath)) {
    +        this.events.emit('verbose', 'Generating defaults.xml from own config.xml for platform "' + this.platform + '"');
    +        shell.cp('-f', ownConfigPath, defaultConfigPath);
    +    }
    +    else {
    +        this.events.emit('verbose', 'case 3"' + this.platform + '"');
    +        shell.cp('-f', sourceCfg.path, ownConfigPath);
         }
     
    -    // this._munger.reapply_global_munge().save_all();
    -
    -    this.config = new ConfigParser(ownConfig);
    +    // merge our configs
    +    this.config = new ConfigParser(ownConfigPath);
         xmlHelpers.mergeXml(cordovaProject.projectConfig.doc.getroot(),
    -        this.config.doc.getroot(), this.platform, true);
    +                        this.config.doc.getroot(),
    +                        this.platform, true);
         this.config.write();
     
    -    /*
    -        "browser": {
    -        "parser_file": "../cordova/metadata/browser_parser",
    -        "handler_file": "../plugman/platforms/browser",
    -        "url": "https://git-wip-us.apache.org/repos/asf?p=cordova-browser.git",
    -        "version": "~4.1.0",
    -        "deprecated": false
    -    }
    -    */
    -
         // Update own www dir with project's www assets and plugins' assets and js-files
         this.parser.update_www(cordovaProject.locations.www);
     
    +    // Copy or Create manifest.json
    +    // todo: move this to a manifest helper module
    +    // output path
    +    var manifestPath = path.join(this.locations.www,'manifest.json');
    +    var srcManifestPath =path.join(cordovaProject.locations.www,'manifest.json');
    +    if(fs.existsSync(srcManifestPath)) {
    +        // just blindly copy it to our output/www
    +        // todo: validate it? ensure all properties we expect exist?
    +        this.events.emit('verbose','copying ' + srcManifestPath + ' => ' + manifestPath);
    +        shell.cp('-f',srcManifestPath,manifestPath);
    +    }
    +    else {
    +        var manifestJson = {
    +            "background_color": "#000",
    +            "display": "standalone"
    +        };
    +        if(this.config){
    +            if(this.config.name()) {
    +                manifestJson.name = this.config.name();
    +            }
    +            if(this.config.shortName()) {
    +                manifestJson.short_name = this.config.shortName();
    +            }
    +            if(this.config.packageName()) {
    +                manifestJson.version = this.config.packageName();
    +            }
    +            if(this.config.description()) {
    +                manifestJson.description = this.config.description();
    +            }
    +            if(this.config.author()) {
    +                manifestJson.author = this.config.author();
    +            }
    +            // icons
    +            var icons = this.config.getStaticResources('browser','icon');
    +            var manifestIcons = icons.map(function(icon) {
    +                // given a tag like this :
    +                // <icon src="res/ios/icon.png" width="57" height="57" density="mdpi" />
    +                /* configParser returns icons that look like this :
    +                {   src: 'res/ios/icon.png',
    +                    target: undefined,
    +                    density: 'mdpi',
    +                    platform: null,
    +                    width: 57,
    +                    height: 57
    +                } ******/
    +                /* manifest expects them to be like this :
    +                {   "src": "images/touch/icon-128x128.png",
    +                    "type": "image/png",
    +                    "sizes": "128x128"
    +                } ******/
    +                // ?Is it worth looking at file extentions?
    +                return {"src":icon.src, "type":"image/png",
    +                        "sizes":(icon.width + "x" + icon.height)};
    +            });
    +            manifestJson.icons = manifestIcons;
    +
    +            // orientation
    +            // <preference name="Orientation" value="landscape" />
    +            var oriPref = this.config.getGlobalPreference('Orientation');
    +            if(oriPref && ["landscape","portrait"].indexOf(oriPref) > -1) {
    +                manifestJson.orientation = oriPref;
    +            }
    +
    +            // get start_url
    +            var contentNode = this.config.doc.find('content') || {'attrib':{'src':'index.html'}}; // sensible default
    +            manifestJson.start_url = contentNode.attrib.src;
    +
    +            // now we get some values from start_url page ...
    +            var startUrlPath = path.join(cordovaProject.locations.www,manifestJson.start_url);
    +            if(fs.existsSync(startUrlPath)) {
    +                var contents = fs.readFileSync(startUrlPath, 'utf-8');
    +                // matches <meta name="theme-color" content="#FF0044">
    +                var themeColorRegex = /<meta(?=[^>]*name="theme-color")\s[^>]*content="([^>]*)"/i;
    +                var result = themeColorRegex.exec(contents);
    +                var themeColor;
    +                if(result && result.length>=2) {
    +                    themeColor = result[1];
    +                }
    +                else { // see if there is a preference in config.xml
    +                    // <preference name="StatusBarBackgroundColor" value="#000000" />
    +                    themeColor = this.config.getGlobalPreference('StatusBarBackgroundColor');
    --- End diff --
    
    Why would we ignore some values? What is wrong with a black statusbar?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-browser pull request #32: CB-12804 : support manifest.json

Posted by purplecabbage <gi...@git.apache.org>.
Github user purplecabbage commented on a diff in the pull request:

    https://github.com/apache/cordova-browser/pull/32#discussion_r124158440
  
    --- Diff: bin/template/www/cordova-sw.js ---
    @@ -0,0 +1,23 @@
    +
    +// Note, these will be updated automatically at build time
    +var CACHE_VERSION = '%CACHE_VERSION%';
    +var CACHE_LIST = ['CACHE_VALUES'];
    +
    +this.addEventListener('install', function(event) {
    +    // Perform install steps
    +    console.log("cordova service worker is installing.");
    +    event.waitUntil(caches.open(CACHE_VERSION)
    +    .then(function(cache) {
    +        return cache.addAll(CACHE_LIST);
    +    }));
    +});
    +
    +this.addEventListener('activate', function(event) {
    +    // Perform activate steps
    +    console.log("cordova service worker is activated.");
    +});
    +
    +this.addEventListener('fetch', function(event) {
    +    console.log("cordova service worker : fetch : " + event.request.url);
    +    event.respondWith(caches.match(event.request));
    --- End diff --
    
    defensively added to #36


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-browser pull request #32: CB-12804 : support manifest.json

Posted by macdonst <gi...@git.apache.org>.
Github user macdonst commented on a diff in the pull request:

    https://github.com/apache/cordova-browser/pull/32#discussion_r122782108
  
    --- Diff: bin/template/cordova/Api.js ---
    @@ -113,52 +110,135 @@ Api.prototype.getPlatformInfo = function () {
             "locations":this.locations,
             "root": this.root,
             "name": this.platform,
    -        "version": { "version" : "1.0.0" },
    +        "version": { "version" : "1.0.0" }, // um, todo!
             "projectConfig": this.config
         };
     };
     
     Api.prototype.prepare = function (cordovaProject,options) {
     
         // First cleanup current config and merge project's one into own
    -    var defaultConfig = path.join(this.locations.platformRootDir,'cordova',
    +    var defaultConfigPath = path.join(this.locations.platformRootDir,'cordova',
                             'defaults.xml');
    -
    -    var ownConfig = this.locations.configXml;
    -
    +    var ownConfigPath = this.locations.configXml;
         var sourceCfg = cordovaProject.projectConfig;
    +
         // If defaults.xml is present, overwrite platform config.xml with it.
         // Otherwise save whatever is there as defaults so it can be
         // restored or copy project config into platform if none exists.
    -    if (fs.existsSync(defaultConfig)) {
    +    if (fs.existsSync(defaultConfigPath)) {
             this.events.emit('verbose', 'Generating config.xml from defaults for platform "' + this.platform + '"');
    -        shell.cp('-f', defaultConfig, ownConfig);
    -    } else if (fs.existsSync(ownConfig)) {
    -        shell.cp('-f', ownConfig, defaultConfig);
    -    } else {
    -        shell.cp('-f', sourceCfg.path, ownConfig);
    +        shell.cp('-f', defaultConfigPath, ownConfigPath);
    +    }
    +    else if (fs.existsSync(ownConfigPath)) {
    +        this.events.emit('verbose', 'Generating defaults.xml from own config.xml for platform "' + this.platform + '"');
    +        shell.cp('-f', ownConfigPath, defaultConfigPath);
    +    }
    +    else {
    +        this.events.emit('verbose', 'case 3"' + this.platform + '"');
    +        shell.cp('-f', sourceCfg.path, ownConfigPath);
         }
     
    -    // this._munger.reapply_global_munge().save_all();
    -
    -    this.config = new ConfigParser(ownConfig);
    +    // merge our configs
    +    this.config = new ConfigParser(ownConfigPath);
         xmlHelpers.mergeXml(cordovaProject.projectConfig.doc.getroot(),
    -        this.config.doc.getroot(), this.platform, true);
    +                        this.config.doc.getroot(),
    +                        this.platform, true);
         this.config.write();
     
    -    /*
    -        "browser": {
    -        "parser_file": "../cordova/metadata/browser_parser",
    -        "handler_file": "../plugman/platforms/browser",
    -        "url": "https://git-wip-us.apache.org/repos/asf?p=cordova-browser.git",
    -        "version": "~4.1.0",
    -        "deprecated": false
    -    }
    -    */
    -
         // Update own www dir with project's www assets and plugins' assets and js-files
         this.parser.update_www(cordovaProject.locations.www);
     
    +    // Copy or Create manifest.json
    +    // todo: move this to a manifest helper module
    +    // output path
    +    var manifestPath = path.join(this.locations.www,'manifest.json');
    +    var srcManifestPath =path.join(cordovaProject.locations.www,'manifest.json');
    +    if(fs.existsSync(srcManifestPath)) {
    +        // just blindly copy it to our output/www
    +        // todo: validate it? ensure all properties we expect exist?
    +        this.events.emit('verbose','copying ' + srcManifestPath + ' => ' + manifestPath);
    +        shell.cp('-f',srcManifestPath,manifestPath);
    +    }
    +    else {
    +        var manifestJson = {
    +            "background_color": "#000",
    +            "display": "standalone"
    +        };
    +        if(this.config){
    +            if(this.config.name()) {
    +                manifestJson.name = this.config.name();
    +            }
    +            if(this.config.shortName()) {
    +                manifestJson.short_name = this.config.shortName();
    +            }
    +            if(this.config.packageName()) {
    +                manifestJson.version = this.config.packageName();
    +            }
    +            if(this.config.description()) {
    +                manifestJson.description = this.config.description();
    +            }
    +            if(this.config.author()) {
    +                manifestJson.author = this.config.author();
    +            }
    +            // icons
    +            var icons = this.config.getStaticResources('browser','icon');
    +            var manifestIcons = icons.map(function(icon) {
    +                // given a tag like this :
    +                // <icon src="res/ios/icon.png" width="57" height="57" density="mdpi" />
    +                /* configParser returns icons that look like this :
    +                {   src: 'res/ios/icon.png',
    +                    target: undefined,
    +                    density: 'mdpi',
    +                    platform: null,
    +                    width: 57,
    +                    height: 57
    +                } ******/
    +                /* manifest expects them to be like this :
    +                {   "src": "images/touch/icon-128x128.png",
    +                    "type": "image/png",
    +                    "sizes": "128x128"
    +                } ******/
    +                // ?Is it worth looking at file extentions?
    --- End diff --
    
    Yeah, I think it makes sense to look at the file extension to figure out the mimeType. Some folks might use jpg for their icons. In that case we should warn folks that png is the preferred format (that is based on something I remember reading from Google).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-browser pull request #32: CB-12804 : support manifest.json

Posted by macdonst <gi...@git.apache.org>.
Github user macdonst commented on a diff in the pull request:

    https://github.com/apache/cordova-browser/pull/32#discussion_r122786410
  
    --- Diff: cordova-js-src/confighelper.js ---
    @@ -61,14 +61,9 @@ function readConfig(success, error) {
             }
         };
     
    -    if ("ActiveXObject" in window) {
    -        // Needed for XHR-ing via file:// protocol in IE
    -        xhr = new window.ActiveXObject("MSXML2.XMLHTTP");
    --- End diff --
    
    Hahahahahaha, I'm so old.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-browser pull request #32: CB-12804 : support manifest.json

Posted by purplecabbage <gi...@git.apache.org>.
Github user purplecabbage commented on a diff in the pull request:

    https://github.com/apache/cordova-browser/pull/32#discussion_r124158393
  
    --- Diff: bin/template/cordova/Api.js ---
    @@ -113,52 +110,135 @@ Api.prototype.getPlatformInfo = function () {
             "locations":this.locations,
             "root": this.root,
             "name": this.platform,
    -        "version": { "version" : "1.0.0" },
    +        "version": { "version" : "1.0.0" }, // um, todo!
             "projectConfig": this.config
         };
     };
     
     Api.prototype.prepare = function (cordovaProject,options) {
     
         // First cleanup current config and merge project's one into own
    -    var defaultConfig = path.join(this.locations.platformRootDir,'cordova',
    +    var defaultConfigPath = path.join(this.locations.platformRootDir,'cordova',
                             'defaults.xml');
    -
    -    var ownConfig = this.locations.configXml;
    -
    +    var ownConfigPath = this.locations.configXml;
         var sourceCfg = cordovaProject.projectConfig;
    +
         // If defaults.xml is present, overwrite platform config.xml with it.
         // Otherwise save whatever is there as defaults so it can be
         // restored or copy project config into platform if none exists.
    -    if (fs.existsSync(defaultConfig)) {
    +    if (fs.existsSync(defaultConfigPath)) {
             this.events.emit('verbose', 'Generating config.xml from defaults for platform "' + this.platform + '"');
    -        shell.cp('-f', defaultConfig, ownConfig);
    -    } else if (fs.existsSync(ownConfig)) {
    -        shell.cp('-f', ownConfig, defaultConfig);
    -    } else {
    -        shell.cp('-f', sourceCfg.path, ownConfig);
    +        shell.cp('-f', defaultConfigPath, ownConfigPath);
    +    }
    +    else if (fs.existsSync(ownConfigPath)) {
    +        this.events.emit('verbose', 'Generating defaults.xml from own config.xml for platform "' + this.platform + '"');
    +        shell.cp('-f', ownConfigPath, defaultConfigPath);
    +    }
    +    else {
    +        this.events.emit('verbose', 'case 3"' + this.platform + '"');
    +        shell.cp('-f', sourceCfg.path, ownConfigPath);
         }
     
    -    // this._munger.reapply_global_munge().save_all();
    -
    -    this.config = new ConfigParser(ownConfig);
    +    // merge our configs
    +    this.config = new ConfigParser(ownConfigPath);
         xmlHelpers.mergeXml(cordovaProject.projectConfig.doc.getroot(),
    -        this.config.doc.getroot(), this.platform, true);
    +                        this.config.doc.getroot(),
    +                        this.platform, true);
         this.config.write();
     
    -    /*
    -        "browser": {
    -        "parser_file": "../cordova/metadata/browser_parser",
    -        "handler_file": "../plugman/platforms/browser",
    -        "url": "https://git-wip-us.apache.org/repos/asf?p=cordova-browser.git",
    -        "version": "~4.1.0",
    -        "deprecated": false
    -    }
    -    */
    -
         // Update own www dir with project's www assets and plugins' assets and js-files
         this.parser.update_www(cordovaProject.locations.www);
     
    +    // Copy or Create manifest.json
    +    // todo: move this to a manifest helper module
    +    // output path
    +    var manifestPath = path.join(this.locations.www,'manifest.json');
    +    var srcManifestPath =path.join(cordovaProject.locations.www,'manifest.json');
    +    if(fs.existsSync(srcManifestPath)) {
    +        // just blindly copy it to our output/www
    +        // todo: validate it? ensure all properties we expect exist?
    +        this.events.emit('verbose','copying ' + srcManifestPath + ' => ' + manifestPath);
    +        shell.cp('-f',srcManifestPath,manifestPath);
    +    }
    +    else {
    +        var manifestJson = {
    +            "background_color": "#000",
    +            "display": "standalone"
    +        };
    +        if(this.config){
    +            if(this.config.name()) {
    +                manifestJson.name = this.config.name();
    +            }
    +            if(this.config.shortName()) {
    +                manifestJson.short_name = this.config.shortName();
    +            }
    +            if(this.config.packageName()) {
    +                manifestJson.version = this.config.packageName();
    +            }
    +            if(this.config.description()) {
    +                manifestJson.description = this.config.description();
    +            }
    +            if(this.config.author()) {
    +                manifestJson.author = this.config.author();
    +            }
    +            // icons
    +            var icons = this.config.getStaticResources('browser','icon');
    +            var manifestIcons = icons.map(function(icon) {
    +                // given a tag like this :
    +                // <icon src="res/ios/icon.png" width="57" height="57" density="mdpi" />
    +                /* configParser returns icons that look like this :
    +                {   src: 'res/ios/icon.png',
    +                    target: undefined,
    +                    density: 'mdpi',
    +                    platform: null,
    +                    width: 57,
    +                    height: 57
    +                } ******/
    +                /* manifest expects them to be like this :
    +                {   "src": "images/touch/icon-128x128.png",
    +                    "type": "image/png",
    +                    "sizes": "128x128"
    +                } ******/
    +                // ?Is it worth looking at file extentions?
    +                return {"src":icon.src, "type":"image/png",
    +                        "sizes":(icon.width + "x" + icon.height)};
    +            });
    +            manifestJson.icons = manifestIcons;
    +
    +            // orientation
    +            // <preference name="Orientation" value="landscape" />
    +            var oriPref = this.config.getGlobalPreference('Orientation');
    +            if(oriPref && ["landscape","portrait"].indexOf(oriPref) > -1) {
    +                manifestJson.orientation = oriPref;
    +            }
    --- End diff --
    
    all other values will be mapped to 'any' in #36


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-browser pull request #32: CB-12804 : support manifest.json

Posted by purplecabbage <gi...@git.apache.org>.
Github user purplecabbage commented on a diff in the pull request:

    https://github.com/apache/cordova-browser/pull/32#discussion_r124158333
  
    --- Diff: bin/template/cordova/Api.js ---
    @@ -113,52 +110,135 @@ Api.prototype.getPlatformInfo = function () {
             "locations":this.locations,
             "root": this.root,
             "name": this.platform,
    -        "version": { "version" : "1.0.0" },
    +        "version": { "version" : "1.0.0" }, // um, todo!
             "projectConfig": this.config
         };
     };
     
     Api.prototype.prepare = function (cordovaProject,options) {
     
         // First cleanup current config and merge project's one into own
    -    var defaultConfig = path.join(this.locations.platformRootDir,'cordova',
    +    var defaultConfigPath = path.join(this.locations.platformRootDir,'cordova',
                             'defaults.xml');
    -
    -    var ownConfig = this.locations.configXml;
    -
    +    var ownConfigPath = this.locations.configXml;
         var sourceCfg = cordovaProject.projectConfig;
    +
         // If defaults.xml is present, overwrite platform config.xml with it.
         // Otherwise save whatever is there as defaults so it can be
         // restored or copy project config into platform if none exists.
    -    if (fs.existsSync(defaultConfig)) {
    +    if (fs.existsSync(defaultConfigPath)) {
             this.events.emit('verbose', 'Generating config.xml from defaults for platform "' + this.platform + '"');
    -        shell.cp('-f', defaultConfig, ownConfig);
    -    } else if (fs.existsSync(ownConfig)) {
    -        shell.cp('-f', ownConfig, defaultConfig);
    -    } else {
    -        shell.cp('-f', sourceCfg.path, ownConfig);
    +        shell.cp('-f', defaultConfigPath, ownConfigPath);
    +    }
    +    else if (fs.existsSync(ownConfigPath)) {
    +        this.events.emit('verbose', 'Generating defaults.xml from own config.xml for platform "' + this.platform + '"');
    +        shell.cp('-f', ownConfigPath, defaultConfigPath);
    +    }
    +    else {
    +        this.events.emit('verbose', 'case 3"' + this.platform + '"');
    +        shell.cp('-f', sourceCfg.path, ownConfigPath);
         }
     
    -    // this._munger.reapply_global_munge().save_all();
    -
    -    this.config = new ConfigParser(ownConfig);
    +    // merge our configs
    +    this.config = new ConfigParser(ownConfigPath);
         xmlHelpers.mergeXml(cordovaProject.projectConfig.doc.getroot(),
    -        this.config.doc.getroot(), this.platform, true);
    +                        this.config.doc.getroot(),
    +                        this.platform, true);
         this.config.write();
     
    -    /*
    -        "browser": {
    -        "parser_file": "../cordova/metadata/browser_parser",
    -        "handler_file": "../plugman/platforms/browser",
    -        "url": "https://git-wip-us.apache.org/repos/asf?p=cordova-browser.git",
    -        "version": "~4.1.0",
    -        "deprecated": false
    -    }
    -    */
    -
         // Update own www dir with project's www assets and plugins' assets and js-files
         this.parser.update_www(cordovaProject.locations.www);
     
    +    // Copy or Create manifest.json
    +    // todo: move this to a manifest helper module
    +    // output path
    +    var manifestPath = path.join(this.locations.www,'manifest.json');
    +    var srcManifestPath =path.join(cordovaProject.locations.www,'manifest.json');
    +    if(fs.existsSync(srcManifestPath)) {
    +        // just blindly copy it to our output/www
    +        // todo: validate it? ensure all properties we expect exist?
    +        this.events.emit('verbose','copying ' + srcManifestPath + ' => ' + manifestPath);
    +        shell.cp('-f',srcManifestPath,manifestPath);
    +    }
    +    else {
    +        var manifestJson = {
    +            "background_color": "#000",
    --- End diff --
    
    Changed to white in #36


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-browser pull request #32: CB-12804 : support manifest.json

Posted by macdonst <gi...@git.apache.org>.
Github user macdonst commented on a diff in the pull request:

    https://github.com/apache/cordova-browser/pull/32#discussion_r122782989
  
    --- Diff: bin/template/cordova/Api.js ---
    @@ -113,52 +110,135 @@ Api.prototype.getPlatformInfo = function () {
             "locations":this.locations,
             "root": this.root,
             "name": this.platform,
    -        "version": { "version" : "1.0.0" },
    +        "version": { "version" : "1.0.0" }, // um, todo!
             "projectConfig": this.config
         };
     };
     
     Api.prototype.prepare = function (cordovaProject,options) {
     
         // First cleanup current config and merge project's one into own
    -    var defaultConfig = path.join(this.locations.platformRootDir,'cordova',
    +    var defaultConfigPath = path.join(this.locations.platformRootDir,'cordova',
                             'defaults.xml');
    -
    -    var ownConfig = this.locations.configXml;
    -
    +    var ownConfigPath = this.locations.configXml;
         var sourceCfg = cordovaProject.projectConfig;
    +
         // If defaults.xml is present, overwrite platform config.xml with it.
         // Otherwise save whatever is there as defaults so it can be
         // restored or copy project config into platform if none exists.
    -    if (fs.existsSync(defaultConfig)) {
    +    if (fs.existsSync(defaultConfigPath)) {
             this.events.emit('verbose', 'Generating config.xml from defaults for platform "' + this.platform + '"');
    -        shell.cp('-f', defaultConfig, ownConfig);
    -    } else if (fs.existsSync(ownConfig)) {
    -        shell.cp('-f', ownConfig, defaultConfig);
    -    } else {
    -        shell.cp('-f', sourceCfg.path, ownConfig);
    +        shell.cp('-f', defaultConfigPath, ownConfigPath);
    +    }
    +    else if (fs.existsSync(ownConfigPath)) {
    +        this.events.emit('verbose', 'Generating defaults.xml from own config.xml for platform "' + this.platform + '"');
    +        shell.cp('-f', ownConfigPath, defaultConfigPath);
    +    }
    +    else {
    +        this.events.emit('verbose', 'case 3"' + this.platform + '"');
    +        shell.cp('-f', sourceCfg.path, ownConfigPath);
         }
     
    -    // this._munger.reapply_global_munge().save_all();
    -
    -    this.config = new ConfigParser(ownConfig);
    +    // merge our configs
    +    this.config = new ConfigParser(ownConfigPath);
         xmlHelpers.mergeXml(cordovaProject.projectConfig.doc.getroot(),
    -        this.config.doc.getroot(), this.platform, true);
    +                        this.config.doc.getroot(),
    +                        this.platform, true);
         this.config.write();
     
    -    /*
    -        "browser": {
    -        "parser_file": "../cordova/metadata/browser_parser",
    -        "handler_file": "../plugman/platforms/browser",
    -        "url": "https://git-wip-us.apache.org/repos/asf?p=cordova-browser.git",
    -        "version": "~4.1.0",
    -        "deprecated": false
    -    }
    -    */
    -
         // Update own www dir with project's www assets and plugins' assets and js-files
         this.parser.update_www(cordovaProject.locations.www);
     
    +    // Copy or Create manifest.json
    +    // todo: move this to a manifest helper module
    +    // output path
    +    var manifestPath = path.join(this.locations.www,'manifest.json');
    +    var srcManifestPath =path.join(cordovaProject.locations.www,'manifest.json');
    +    if(fs.existsSync(srcManifestPath)) {
    +        // just blindly copy it to our output/www
    +        // todo: validate it? ensure all properties we expect exist?
    +        this.events.emit('verbose','copying ' + srcManifestPath + ' => ' + manifestPath);
    +        shell.cp('-f',srcManifestPath,manifestPath);
    +    }
    +    else {
    +        var manifestJson = {
    +            "background_color": "#000",
    +            "display": "standalone"
    +        };
    +        if(this.config){
    +            if(this.config.name()) {
    +                manifestJson.name = this.config.name();
    +            }
    +            if(this.config.shortName()) {
    +                manifestJson.short_name = this.config.shortName();
    +            }
    +            if(this.config.packageName()) {
    +                manifestJson.version = this.config.packageName();
    +            }
    +            if(this.config.description()) {
    +                manifestJson.description = this.config.description();
    +            }
    +            if(this.config.author()) {
    +                manifestJson.author = this.config.author();
    +            }
    +            // icons
    +            var icons = this.config.getStaticResources('browser','icon');
    +            var manifestIcons = icons.map(function(icon) {
    +                // given a tag like this :
    +                // <icon src="res/ios/icon.png" width="57" height="57" density="mdpi" />
    +                /* configParser returns icons that look like this :
    +                {   src: 'res/ios/icon.png',
    +                    target: undefined,
    +                    density: 'mdpi',
    +                    platform: null,
    +                    width: 57,
    +                    height: 57
    +                } ******/
    +                /* manifest expects them to be like this :
    +                {   "src": "images/touch/icon-128x128.png",
    +                    "type": "image/png",
    +                    "sizes": "128x128"
    +                } ******/
    +                // ?Is it worth looking at file extentions?
    +                return {"src":icon.src, "type":"image/png",
    +                        "sizes":(icon.width + "x" + icon.height)};
    +            });
    +            manifestJson.icons = manifestIcons;
    +
    +            // orientation
    +            // <preference name="Orientation" value="landscape" />
    +            var oriPref = this.config.getGlobalPreference('Orientation');
    +            if(oriPref && ["landscape","portrait"].indexOf(oriPref) > -1) {
    +                manifestJson.orientation = oriPref;
    +            }
    --- End diff --
    
    if `Orientation` is set to `default` we should probably set the manifest value to `any`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-browser pull request #32: CB-12804 : support manifest.json

Posted by macdonst <gi...@git.apache.org>.
Github user macdonst commented on a diff in the pull request:

    https://github.com/apache/cordova-browser/pull/32#discussion_r122787134
  
    --- Diff: cordova-lib/cordova.js ---
    @@ -1486,6 +1486,26 @@ module.exports = {
     
         bootstrap: function() {
     
    +        var cache = navigator.serviceWorker.register;
    --- End diff --
    
    This seems like a great solution for detecting if a service worker has been registered.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-browser pull request #32: CB-12804 : support manifest.json

Posted by macdonst <gi...@git.apache.org>.
Github user macdonst commented on a diff in the pull request:

    https://github.com/apache/cordova-browser/pull/32#discussion_r122783962
  
    --- Diff: bin/template/cordova/Api.js ---
    @@ -113,52 +110,135 @@ Api.prototype.getPlatformInfo = function () {
             "locations":this.locations,
             "root": this.root,
             "name": this.platform,
    -        "version": { "version" : "1.0.0" },
    +        "version": { "version" : "1.0.0" }, // um, todo!
             "projectConfig": this.config
         };
     };
     
     Api.prototype.prepare = function (cordovaProject,options) {
     
         // First cleanup current config and merge project's one into own
    -    var defaultConfig = path.join(this.locations.platformRootDir,'cordova',
    +    var defaultConfigPath = path.join(this.locations.platformRootDir,'cordova',
                             'defaults.xml');
    -
    -    var ownConfig = this.locations.configXml;
    -
    +    var ownConfigPath = this.locations.configXml;
         var sourceCfg = cordovaProject.projectConfig;
    +
         // If defaults.xml is present, overwrite platform config.xml with it.
         // Otherwise save whatever is there as defaults so it can be
         // restored or copy project config into platform if none exists.
    -    if (fs.existsSync(defaultConfig)) {
    +    if (fs.existsSync(defaultConfigPath)) {
             this.events.emit('verbose', 'Generating config.xml from defaults for platform "' + this.platform + '"');
    -        shell.cp('-f', defaultConfig, ownConfig);
    -    } else if (fs.existsSync(ownConfig)) {
    -        shell.cp('-f', ownConfig, defaultConfig);
    -    } else {
    -        shell.cp('-f', sourceCfg.path, ownConfig);
    +        shell.cp('-f', defaultConfigPath, ownConfigPath);
    +    }
    +    else if (fs.existsSync(ownConfigPath)) {
    +        this.events.emit('verbose', 'Generating defaults.xml from own config.xml for platform "' + this.platform + '"');
    +        shell.cp('-f', ownConfigPath, defaultConfigPath);
    +    }
    +    else {
    +        this.events.emit('verbose', 'case 3"' + this.platform + '"');
    +        shell.cp('-f', sourceCfg.path, ownConfigPath);
         }
     
    -    // this._munger.reapply_global_munge().save_all();
    -
    -    this.config = new ConfigParser(ownConfig);
    +    // merge our configs
    +    this.config = new ConfigParser(ownConfigPath);
         xmlHelpers.mergeXml(cordovaProject.projectConfig.doc.getroot(),
    -        this.config.doc.getroot(), this.platform, true);
    +                        this.config.doc.getroot(),
    +                        this.platform, true);
         this.config.write();
     
    -    /*
    -        "browser": {
    -        "parser_file": "../cordova/metadata/browser_parser",
    -        "handler_file": "../plugman/platforms/browser",
    -        "url": "https://git-wip-us.apache.org/repos/asf?p=cordova-browser.git",
    -        "version": "~4.1.0",
    -        "deprecated": false
    -    }
    -    */
    -
         // Update own www dir with project's www assets and plugins' assets and js-files
         this.parser.update_www(cordovaProject.locations.www);
     
    +    // Copy or Create manifest.json
    +    // todo: move this to a manifest helper module
    +    // output path
    +    var manifestPath = path.join(this.locations.www,'manifest.json');
    +    var srcManifestPath =path.join(cordovaProject.locations.www,'manifest.json');
    +    if(fs.existsSync(srcManifestPath)) {
    +        // just blindly copy it to our output/www
    +        // todo: validate it? ensure all properties we expect exist?
    +        this.events.emit('verbose','copying ' + srcManifestPath + ' => ' + manifestPath);
    +        shell.cp('-f',srcManifestPath,manifestPath);
    +    }
    +    else {
    +        var manifestJson = {
    +            "background_color": "#000",
    +            "display": "standalone"
    +        };
    +        if(this.config){
    +            if(this.config.name()) {
    +                manifestJson.name = this.config.name();
    +            }
    +            if(this.config.shortName()) {
    +                manifestJson.short_name = this.config.shortName();
    +            }
    +            if(this.config.packageName()) {
    +                manifestJson.version = this.config.packageName();
    +            }
    +            if(this.config.description()) {
    +                manifestJson.description = this.config.description();
    +            }
    +            if(this.config.author()) {
    +                manifestJson.author = this.config.author();
    +            }
    +            // icons
    +            var icons = this.config.getStaticResources('browser','icon');
    +            var manifestIcons = icons.map(function(icon) {
    +                // given a tag like this :
    +                // <icon src="res/ios/icon.png" width="57" height="57" density="mdpi" />
    +                /* configParser returns icons that look like this :
    +                {   src: 'res/ios/icon.png',
    +                    target: undefined,
    +                    density: 'mdpi',
    +                    platform: null,
    +                    width: 57,
    +                    height: 57
    +                } ******/
    +                /* manifest expects them to be like this :
    +                {   "src": "images/touch/icon-128x128.png",
    +                    "type": "image/png",
    +                    "sizes": "128x128"
    +                } ******/
    +                // ?Is it worth looking at file extentions?
    +                return {"src":icon.src, "type":"image/png",
    +                        "sizes":(icon.width + "x" + icon.height)};
    +            });
    +            manifestJson.icons = manifestIcons;
    +
    +            // orientation
    +            // <preference name="Orientation" value="landscape" />
    +            var oriPref = this.config.getGlobalPreference('Orientation');
    +            if(oriPref && ["landscape","portrait"].indexOf(oriPref) > -1) {
    +                manifestJson.orientation = oriPref;
    +            }
    +
    +            // get start_url
    +            var contentNode = this.config.doc.find('content') || {'attrib':{'src':'index.html'}}; // sensible default
    +            manifestJson.start_url = contentNode.attrib.src;
    +
    +            // now we get some values from start_url page ...
    +            var startUrlPath = path.join(cordovaProject.locations.www,manifestJson.start_url);
    +            if(fs.existsSync(startUrlPath)) {
    +                var contents = fs.readFileSync(startUrlPath, 'utf-8');
    +                // matches <meta name="theme-color" content="#FF0044">
    +                var themeColorRegex = /<meta(?=[^>]*name="theme-color")\s[^>]*content="([^>]*)"/i;
    +                var result = themeColorRegex.exec(contents);
    +                var themeColor;
    +                if(result && result.length>=2) {
    +                    themeColor = result[1];
    +                }
    +                else { // see if there is a preference in config.xml
    +                    // <preference name="StatusBarBackgroundColor" value="#000000" />
    +                    themeColor = this.config.getGlobalPreference('StatusBarBackgroundColor');
    --- End diff --
    
    Should we ignore `StatusBarBackgroundColor` if it is set to ['black', '#000', '#000000']?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-browser pull request #32: CB-12804 : support manifest.json

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cordova-browser/pull/32


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-browser pull request #32: CB-12804 : support manifest.json

Posted by macdonst <gi...@git.apache.org>.
Github user macdonst commented on a diff in the pull request:

    https://github.com/apache/cordova-browser/pull/32#discussion_r122786300
  
    --- Diff: bin/template/www/manifest.json ---
    @@ -0,0 +1,21 @@
    +{
    +  "name": "My App",
    +  "short_name":"My Ap",
    +  "description": "Description of your app from template",
    +  "start_url": "index.html",
    +  "scope":"index.html",
    +  "icons": [{
    +    "src": "img/logo.png",
    +    "sizes": "192x192",
    +    "type": "image/png"
    +  }, {
    +    "src": "img/splash.png",
    --- End diff --
    
    I don't think we need the splash in the list of icons. Chrome will use the background_color, short_name and icon closest to 128dp to create a splash screen.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-browser pull request #32: CB-12804 : support manifest.json

Posted by purplecabbage <gi...@git.apache.org>.
Github user purplecabbage commented on a diff in the pull request:

    https://github.com/apache/cordova-browser/pull/32#discussion_r124157183
  
    --- Diff: cordova-js-src/confighelper.js ---
    @@ -61,14 +61,9 @@ function readConfig(success, error) {
             }
         };
     
    -    if ("ActiveXObject" in window) {
    -        // Needed for XHR-ing via file:// protocol in IE
    -        xhr = new window.ActiveXObject("MSXML2.XMLHTTP");
    --- End diff --
    
    I'm older


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org