1
我正在開發一個需要在表單中輸入日期的Chrome擴展。表單正在彈出窗口中顯示。現在,無論何時點擊日曆,整個彈出窗口都會關閉,而不僅僅是日曆。什麼是防止它的最好方法? 這裏是我的文件快照:Chrome擴展中的日曆彈出窗口的問題
的manifest.json
{
"manifest_version": 2,
"name": "Extension Example",
"version": "0.2",
"background": {
"persistent": false
},
"browser_action": {
"default_icon": "icon.png",
"default_popup": "index.html"
},
"permissions": [
"tabs",
"http://*/*",
"https://*/*"
]
}
的index.html
<!doctype html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>Extension Sample</title>
<!-- Bootstrap itself -->
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css">
<!-- Custom styles -->
<link rel="stylesheet" href="css/style.css">
<!-- Fonts -->
<link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Wire+One' rel='stylesheet' type='text/css'>
<body class="theme">
<!-- Main (Home) section -->
<div>
<div class="container">
<div class="row">
<div class="col-md-10 col-lg-10 col-md-offset-1 col-lg-offset-1 text-center">
<h3 class="tagline">Sample</h3>
<div>
<form method="POST">
<div class="row col-sm-8 col-sm-offset-2">
<input class="form-control" type="text">
<input class="form-control" type="date">
<input class="form-control" type="time">
<input class="form-control" type="email">
<br>
<input class="form-control submit" type="submit" value="Submit">
</div>
</form>
</div>
</div> <!-- /col -->
</div> <!-- /row -->
</div>
</div>
<script src="libs/jquery.1.7.0.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="popup.js"></script>
</body>
聽起來像你的問題是http://stackoverflow.com/a/4148839/2336725 – Teepeemm 2014-10-01 00:48:35
@Teepeemm的副本,當我們與其區域外的瀏覽器交互時,彈出式窗口會關閉。這個動作似乎是合乎邏輯的,但在我的情況下,即使點擊它,彈出窗口也會關閉。 – gsrivast 2014-10-01 03:50:05
如果您打開彈出式控制檯,彈出窗口是否保持打開狀態?這似乎表明這是同樣的問題。 – Teepeemm 2014-10-01 14:17:06