Chrome Auto Fill Form Plugin

Source: Internet
Author: User

The main function is to open any Web page plug-in will automatically determine whether the URL is form.php end, if it is the rules automatically fill out the Web form, if not skip.

Manifest.json

{  "name": "Smart Form Assistant",  "description": "AutoFill Application 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 ":" AutoFill Application link Form ",      "Default_icon": "Bird.png"   },  "Manifest_version": 2}

Background.js

Copyright (c) the Chromium Authors. All rights reserved.//Use of this source code are governed by a Bsd-style license, 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 match = Url.match (regex);    if (typeof match! = "undefined" && null! = match) flag = true; return flag;} function Autoaddvalue () {Chrome.tabs.executeScript (null, {code: "var inputs = Document.queryselectorall (' Input                '); Inputs[1].value= ' http://www.xxx.com.cn/'; inputs[2].value= ' xxxx '; inputs[3].value= ' http://www.xx.com.cn/xxx '; Inputs[4].value= ' [email protected] '; var textareas = Document.queryselectorall (' textarea '); textareas[0].value        = ' xxxx '; "}); } Chrome.browserAction.onClicked.addListener (function (tab) {if (check***(Tab.url)) {Autoaddvalue (); Chrome.tabs.executeScript ({code: ' document.body.style.backgroundcolor= ' #f2d649 "'}); Console.log ( ' * * * Form Fill success! ');} Else{console.log (' not * * * website! '); Chrome.tabs.executeScript ({code: ' document.body.style.backgroundcolor= ' #f24182 "'});}); Chrome.tabs.onUpdated.addListener (function (tabid,changeinfo,tab) {if (check*** (Tab.url)) {autoaddvalue (); Chrome.tabs.executeScript ({code: ' document.body.style.backgroundcolor= ' #f2d649 '}); Console.log (' * * * form completed successfully!) ');} Else{console.log (' not * * * website! '); Chrome.tabs.executeScript ({code: ' document.body.style.backgroundcolor= ' #f24182 "'});});

Full code Download: http://download.csdn.net/detail/nerslegmail/8308589

Chrome Auto Fill Form Plugin

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.