locked
do I need a mime type / htaccess? RRS feed

  • Question

  • User379720387 posted

    I have a file in the root of my application called manifest.webapp.

    It started its life as a .js file, which I have since renamed to .webapp, to meet the requirements of the Firefox open web app installation process.

    My default page has a button with some script attached to call the manifest.webapp.

    Here is the code that calls the manifest:

    <script>
    (function(){
    
        debugger
    
      function install(ev) {
        ev.preventDefault();
        // define the manifest URL
        var manifest_url = "http://blahblah.azurewebsites.net/manifest.webapp";
        // install the app
        var myapp = navigator.mozApps.install(manifest_url);
        myapp.onsuccess = function(data) {
          // App is installed, remove button
          this.parentNode.removeChild(this);
        };
        myapp.onerror = function() {
          // App wasn't installed, info is in this.error.name
          console.log('Install failed, error: ' + this.error.name);
         };
      };
      // get a reference to the button and call install() on click
      var button = document.getElementById('install');
      button.addEventListener('click', install, false);
    })();
    </script>
    

    Running the script I can see that manifest_url is null.

    When I browse to this file from the browser I get an error message about the resource not being there.

    The file is there, and I got the filename correct.

    Is this webPages doing its security thing? Is there something I can do to allow access?

    Friday, August 15, 2014 9:37 PM

Answers