【发布时间】:2014-05-15 17:04:55
【问题描述】:
我刚刚构建了我的第一个 Chrome 应用 (https://chrome.google.com/webstore/detail/gitter/ldhcdmnhbafhckhidlhdbeekpifobpdc),但遇到了 cookie 问题。
该应用程序有效地在一个窗口中启动一个 index.html 页面,该页面有一个指向我们常规 Web 应用程序的 web 视图。
如果我在 Mac 上退出 Chrome,每次启动 Gitter Chrome 应用程序时,所有 cookie 似乎都已被清除,因此我必须再次登录(并再次登录 GitHub)。
我不太清楚从哪里开始寻找,如果有人有任何指示,我将不胜感激。
PS。我已经检查了这个问题和答案 (chrome Extension : Set persistent cookie in chrome extension?),据我所知,我的问题与未过期的 cookie 无关,因为我们确实为 cookie 设置了过期时间。
我的清单如下所示:
{
"app": {
"background": {
"scripts": [ "launch.js" ]
}
},
"description": "Chat for GitHub.",
"icons": {
"128": "icon-128.png",
"16": "icon-16.png"
},
"manifest_version": 2,
"name": "Gitter",
"short_name": "Gitter",
"offline_enabled": true,
"permissions": [
"unlimitedStorage",
"notifications",
"webview",
"http://*/*"
],
"version": "1.0.0.3"
}
它启动到一个窗口的页面基本上是这样做的:
<webview id="wv1" style="width:100%; height:100%;"
src="https://gitter.im/">
</webview>
【问题讨论】: