为什么chrome应用程序无法加载我的脱机缓存清单

时间:2017-08-24 11:04:01

标签: google-chrome google-chrome-app html5-appcache

我的Chrome应用无法加载我的离线缓存清单,而普通的Chrome标签就可以了。出于某种原因,在仅下载了几件物品后它就会停止。

"资源提取失败的原因"未指定(读取"未知"在错误本身,见图像)

Chrome应用中的缓存资源是否有内存限制?我用谷歌搜索过,但发现关于Chrome应用程序的这些事情的概述很少。

如果您找到概述这些内容的资源,请链接到该资源。

我尝试添加权限" unlimitedStorage"如此处所述(https://developer.chrome.com/apps/declare_permissions),但没有区别。

    quickstore1:1 Creating Application Cache with manifest http://localhost/cloudsign/web/manifests/24/quickstore1.appcache
    quickstore1:1 Application Cache Checking event
    quickstore1:1 Application Cache Downloading event
    quickstore1:1 Application Cache Progress event (0 of 111) http://localhost/cloudsign/web/uploads/images/6/e69ac4205935739701697ea1c0bf1d7e62a1dc0c.png
    quickstore1:1 Application Cache Progress event (1 of 111) http://localhost/cloudsign/web/uploads/images/6/88881d8511deeb99eb542c147d45ab507c445e5e.png
    quickstore1:1 Application Cache Progress event (2 of 111) http://localhost/cloudsign/web/uploads/images/6/646215b8d3c74f84e19b4d3a853bf24ae75d94d8.png
    quickstore1:1 Application Cache Progress event (3 of 111) http://localhost/cloudsign/web/uploads/images/6/51737da269f814a34d362dcf90ba5d5f07a23529.png
    quickstore1:1 Application Cache Progress event (4 of 111) http://localhost/cloudsign/web/uploads/images/6/3cb1e1b34fcaa3176a7a2b40d3fa491d3460d356.png
    quickstore1:1 Application Cache Progress event (5 of 111) http://localhost/cloudsign/web/uploads/images/24/eb451585360f63292c132013b2c1538a7874939e.png
    quickstore1:1 Application Cache Progress event (6 of 111) http://localhost/cloudsign/web/uploads/images/24/eb0d6bb5f21f134a199c38e7ab15e129aef41e71.jpeg
    quickstore1:1 Application Cache Progress event (7 of 111) http://localhost/cloudsign/web/uploads/images/24/dbeccb61e74710e35a05c9668e40a4b80a32e402.gif
    quickstore1:1 Application Cache Progress event (8 of 111) http://localhost/cloudsign/web/fonts/Gruppo/Gruppo-Regular.ttf
    quickstore1:1 Application Cache Progress event (9 of 111) http://localhost/cloudsign/web/uploads/images/24/dbd3746b08e371516b90b576103e5817e9d244f6.jpeg
    quickstore1:1 Application Cache Progress event (10 of 111) http://localhost/cloudsign/web/uploads/images/6/979e98bd5f23f26f8d22d5d93840f81e3cbec62f.png
    quickstore1:1 Application Cache Error event: Resource fetch failed (2) http://localhost/cloudsign/web/uploads/images/6/979e98bd5f23f26f8d22d5d93840f81e3cbec62f.png
    appCacheHandlers.js:67 Cache error detected (MS)
    cacheError @ appCacheHandlers.js:67
    appCacheHandlers.js:68 error is:
    appCacheHandlers.js:69 ApplicationCacheErrorEventbubbles: falsecancelBubble: falsecancelable: falsecomposed: falsecurrentTarget: ApplicationCache {status: 0, onchecking: null, onerror: null, onnoupdate: null, ondownloading: null, …}defaultPrevented: falseeventPhase: 0isTrusted: truemessage: "Resource fetch failed (2) http://localhost/cloudsign/web/uploads/images/6/979e98bd5f23f26f8d22d5d93840f81e3cbec62f.png"path: []length: 0__proto__: Array(0)concat: ƒ concat()constructor: ƒ Array()copyWithin: ƒ copyWithin()entries: ƒ entries()every: ƒ every()fill: ƒ fill()filter: ƒ filter()find: ƒ find()findIndex: ƒ findIndex()forEach: ƒ forEach()includes: ƒ includes()indexOf: ƒ indexOf()join: ƒ join()keys: ƒ keys()lastIndexOf: ƒ lastIndexOf()length: 0map: ƒ map()pop: ƒ pop()push: ƒ push()reduce: ƒ reduce()reduceRight: ƒ reduceRight()reverse: ƒ reverse()shift: ƒ shift()slice: ƒ slice()some: ƒ some()sort: ƒ sort()splice: ƒ splice()toLocaleString: ƒ toLocaleString()toString: ƒ toString()unshift: ƒ unshift()Symbol(Symbol.iterator): ƒ values()Symbol(Symbol.unscopables): {copyWithin: true, entries: true, fill: true, find: true, findIndex: true, …}__proto__: Objectreason: "unknown"returnValue: truesrcElement: ApplicationCache {status: 0, onchecking: null, onerror: null, onnoupdate: null, ondownloading: null, …}status: 0target: ApplicationCache {status: 0, onchecking: null, onerror: null, onnoupdate: null, ondownloading: null, …}timeStamp: 1501.0700000000002type: "error"url: ""__proto__: ApplicationCacheErrorEventbubbles: (...)cancelBubble: (...)cancelable: (...)composed: (...)currentTarget: (...)defaultPrevented: (...)eventPhase: (...)message: (...)path: (...)reason: (...)returnValue: (...)srcElement: (...)status: (...)target: (...)timeStamp: (...)type: (...)url: (...)constructor: ƒ ApplicationCacheErrorEvent()Symbol(Symbol.toStringTag): "ApplicationCacheErrorEvent"get message: ƒ ()get reason: ƒ ()get status: ƒ ()get url: ƒ ()__proto__: Event

enter image description here

所有代码都是由Chrome应用程序构建器生成的,因此它是标准的,但我将其包含在下面,以防我错过某些设置或类似...

Chrome应用清单:

{  
     "name":"Cloudsign-dev",
     "version":"0.1",
     "manifest_version":2,
     "minimum_chrome_version":"37.0.0.0",
     "permissions":[  
        "webview",
        "power",
        "storage",
        "unlimitedStorage",
        "videoCapture",
        "geolocation",
        "pointerLock",
        "system.display",
        {  
           "fileSystem":[  
              "write",
              "retainEntries",
              "directory"
           ]
        },
        "accessibilityFeatures.read",
        "accessibilityFeatures.modify"
     ],
     "app":{  
        "background":{  
           "scripts":[  
              "js/foam.js",
              "js/cab.js",
              "config.js",
              "background_main.js"
           ]
        }
     },
     "kiosk_enabled":true,
     "default_locale":"en",
     "icons":{  
        "128":"img/128.png"
     }
  }

配置文件:

window.config = {
       "model_": "AppConfig",
       "id": 1,
       "appName": "Cloudsign-dev",
       "homepage": "http://localhost/cloudsign/web/app_dev.php/mp/quickstore1",
       "enableNavBttns": false,
       "enableHomeBttn": false,
       "enableReloadBttn": false,
       "enableLogoutBttn": false,
       "kioskEnabled": true
    };

background_main.js

/**
 * Creates the window for the application.
 *
 * @see http://developer.chrome.com/trunk/apps/app.window.html
 */
var runApp = function() {
  if (chrome.power) {
    chrome.power.requestKeepAwake('display');
  }
  console.log(config);
  chrome.app.window.create(
      config ?
      'exported_app_view.html' :
      'designer_view.html',
      {
        id: 'KioskDesignerWindow',
        width: 1100,
        height: 720,
        minWidth: 800,
        minHeight: 600
      },
      function(win) {
        if (!this.X) { return; }
        var window = win.contentWindow;
        window.onload = function() {
          this.$addWindow(window);
          var Y = this.X.subWindow(window, 'Kiosk Designer Window');
          this.DOM.init(Y);
        }.bind(this);
        win.onClosed.addListener(function() {
          this.$removeWindow(window);
        }.bind(this));
      }.bind(this));
}.bind(this);

/**
 * Listens for the app launching then creates the window
 *
 * @see http://developer.chrome.com/trunk/apps/app.runtime.html
 * @see http://developer.chrome.com/trunk/apps/app.window.html
 */
chrome.app.runtime.onLaunched.addListener(function() {
  runApp();
});


/**
 * Listens for the app restarting then re-creates the window.
 *
 * @see http://developer.chrome.com/trunk/apps/app.runtime.html
 */
chrome.app.runtime.onRestarted.addListener(function() {
  runApp();
});

1 个答案:

答案 0 :(得分:0)

好的原因似乎是内存限制(5 mb?),我无法以任何方式更改webapp。如果我将我的所有代码移动到应用程序而不是网站,我想我可以使用无限存储,但应用程序缓存似乎不支持chrome-app-side在任何情况下重新编码=(