Chrome automatically fills in the form plug-in, chrome fills in the form

Source: Internet
Author: User

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

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.