Javascript 自动填充脚本不';行不通

Javascript 自动填充脚本不';行不通,javascript,google-chrome,login,autofill,Javascript,Google Chrome,Login,Autofill,之前,用户Robin(谢谢)帮助我解决了代码中的一些键入错误。无论如何,当我点击按钮使代码工作时,它什么也不做 我的错误在哪里?多谢各位 代码如下: Manifest.json { "name": "Bwin pages", "version": "1.0", "manifest_version": 2, "description": "Open Bwin pages", "background": {"scripts": ["background.js"]}, "browser_actio

之前,用户Robin(谢谢)帮助我解决了代码中的一些键入错误。无论如何,当我点击按钮使代码工作时,它什么也不做

我的错误在哪里?多谢各位

代码如下:

Manifest.json

{  
"name": "Bwin pages",
"version": "1.0",
"manifest_version": 2,
"description": "Open Bwin pages",
"background": {"scripts": ["background.js"]},
"browser_action": {"default_icon": "icon.gif"},
"permissions": ["tabs","activeTab","https://www.bwin.com"],
"content_scripts": [{
"matches": ["https://www.bwin.com/"],
"js": ["autofill.js"]
                   }],
"run_at": "document_end",
"all_frames": true

}
Background.js

console.log("Background.js Started .. "); 
chrome.browserAction.onClicked.addListener(function (tab) {chrome.tabs.executeScript(tab.id, {file: 'autofill.js'});
console.log("Script Executed .. "); 
});
console.log("Autofill.js Started .. "); 
var myUsername = "aaa";
var myPassword = "bbb";

var loginField = document.getElementById("ct106_ct107_loginview_baw_template_logincontrol_edtUsername");
var passwordField = document.getElementById("ct106_ct107_loginview_baw_template_logincontrol_edtPassword");

loginField.value = myUsername;
passwordField.value = myPassword;

var loginForm = document.getElementById ("ct106_ct107_loginview_baw_template_logincontrol_btnLogin");

loginForm.submit();
checkCookie();
Autofill.js

console.log("Background.js Started .. "); 
chrome.browserAction.onClicked.addListener(function (tab) {chrome.tabs.executeScript(tab.id, {file: 'autofill.js'});
console.log("Script Executed .. "); 
});
console.log("Autofill.js Started .. "); 
var myUsername = "aaa";
var myPassword = "bbb";

var loginField = document.getElementById("ct106_ct107_loginview_baw_template_logincontrol_edtUsername");
var passwordField = document.getElementById("ct106_ct107_loginview_baw_template_logincontrol_edtPassword");

loginField.value = myUsername;
passwordField.value = myPassword;

var loginForm = document.getElementById ("ct106_ct107_loginview_baw_template_logincontrol_btnLogin");

loginForm.submit();
checkCookie();
“content_script”部分需要是一个对象数组,因为扩展可以包含多个匹配不同模式的内容脚本

例如


谢谢你,罗宾。我现在有这些问题:无法识别的清单键“all_frames”。无法识别的清单键“run_at”。权限“”未知或URL模式格式不正确。你能帮帮我吗?好的,我以前写的问题都解决了。无论如何,当我点击按钮使代码工作时,它什么也不做。有人能帮我吗?