主要功能是打开任意网页插件会自动判断URL是否是结尾,如果是则按照规则自动填写网页表单,如果不是则略过。
{
"name": "智能表单助手",
"description": "自动填充***申请友情链接表单",
"version": "1.0",
"permissions": [
"tabs", "http://*/plus/flink_add.php", "https://*/plus/flink_add.php"
],
"background": {
"scripts": [""],
"persistent": false
},
"browser_action": {
"default_title": "自动填充***申请友情链接表单",
"default_icon": ""
},
"manifest_version": 2
}
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Called when the user clicks on the browser action.
function check***(url){
('URL:'+url);
var flag = false;
if(typeof url == "undefined" || null == url)
url = ;
var regex = /.*\:\/\/.*\//;
var match = (regex);
if(typeof match != "undefined" && null != match)
flag = true;
return flag;
}
function autoAddValue()
{
(null,
{code:" var inputs = ('input');\
inputs[1].value='/';\
inputs[2].value='xxxx';\
inputs[3].value='/xxx';\
inputs[4].value='xxx@';\
var textareas = ('textarea');\
textareas[0].value='xxxx';\
"});
}
(function(tab) {
if(check***())
{
autoAddValue();
({
code: '="#f2d649"'
});
('*** 表单填写成功!');
}
else
{
('不是***网站!');
({
code: '="#f24182"'
});
}
});
(
function(tabId,changeInfo,tab){
if(check***())
{
autoAddValue();
({
code: '="#f2d649"'
});
('*** 表单填写成功!');
}
else
{
('不是***网站!');
({
code: '="#f24182"'
});
}
});
完整代码下载:/detail/nerslegmail/8308589