0
javascriptファイル(config_content_script)からOpenダイアログに関する問題があります。私は "chrome.windows.create"を使用し、エラーがあります: "未定義のプロパティ 'create'を読み取ることができません。何かお考えですか? ありがとうございました! マイソース:Chrome拡張機能 - javascriptファイルからのダイアログを開く(content_scriptの設定)
**manifest.json**
{
"name": "ABC",
"short_name": "ABC",
"description": "My tool",
"permissions": [ "contentSettings", "tabs", "http://*/*", "https://*/*" , "https://localhost/*", "https://localhost/*/*", "contextMenus"],
"homepage_url": "http://www.localhost/GMS",
"update_url": "https://clients2.google.com/service/update2/crx",
"manifest_version": 2,
"version": "1.0.4",
"icons": {
"16": "img/icon-16.png",
"48": "img/icon-48.png"
},
"browser_action": {
"default_icon": "img/icon-128.png",
"default_popup": "background.html"
},
"content_scripts": [{
"css": [ "addon_tool.css" ],
"js": [ "jquery.js", "config.js","myJs.js"]
}]
}
**myJS.js**
$.ajax({
type: "POST",
data:{UserName: 'name'},
dataType: "json",
url: "https://localhost/...",
success: function (data) {
alert('OK');
},
error: function (xhr, status, error) {
try {
***chrome.windows.create({ 'url': 'PopupForm.html', 'type': 'popup' }, function (window) {***
});
} catch (e) {
alert(e.message);
}
}
});
**PopupForm.html**
<!DOCTYPE html>
<html>
<head>
<title></title>
\t <meta charset="utf-8" />
</head>
<body>
<button id="btnSubmit" >Submit</button>
<button id="btnCancel" >Close</button>
</body>
</html>
返信いただきありがとうございます。しかし、私はコンテンツスクリプトを使用する必要があります。私の問題は、コンテンツスクリプト(myJS.js)からのショーダイアログです。 –