Chrome automatically fills in the form plug-in, chrome fills in the form
The main function is to open any web page plug-in to automatically determine whether the URL ends with form. php. If yes, the web page form is automatically entered according to the rules. If not, the web page form is skipped.
Manifest. json
{"Name": "smart form assistant", "description": "automatically fill in the *** apply for link form", "version": "1.0", "permissions ": ["tabs", "http: // */plus/flink_add.php", "https: // */plus/flink_add.php"], "background": {"scripts ": ["background. js "]," persistent ": false}," browser_action ": {" default_title ":" Auto Fill *** apply for link form "," default_icon ": "bird.png"}, "manifest_version": 2}
Background. js
// 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) {console. log ('url: '+ URL); var flag = false; if (typeof url = "undefined" | null = url) url = window. location. href; var regex = /. *\:\/\/. * \/form. php/; var ma Tch = url. match (regex); if (typeof match! = "Undefined" & null! = Match) flag = true; return flag;} function autoAddValue () {chrome.tabs.exe cuteScript (null, {code: "var inputs = document. querySelectorAll ('input'); \ inputs [1]. value = 'HTTP: // your textareas = document. querySelectorAll ('textarea '); \ textareas [0]. value = 'xxxx'; \ "});} chrome. browserAction. OnClicked. addListener (function (tab) {if (check *** (tab.url?{{autoaddvalue();;chrome.tabs.exe cuteScript ({code: 'document. body. style. backgroundColor = "# f2d649" '}); console. log ('*** form filled in successfully! ');} Else {console. log (' not a *** website! '); Chrome.tabs.exe cuteScript ({code: 'document. body. style. backgroundColor = "# f24182" '}) ;}}; chrome. tabs. onUpdated. addListener (function (tabId, changeInfo, tab) {if (check *** (tab.url?##autoaddvalue({;chrome.tabs.exe cuteScript ({code: 'document. body. style. backgroundColor = "# f2d649" '}); console. log ('*** form filled in successfully! ');} Else {console. log (' not a *** website! '); Chrome.tabs.exe cuteScript ({code: 'document. body. style. backgroundColor = "# f24182 "'});}});
Full download: http://download.csdn.net/detail/nerslegmail/8308589