|
- (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
- 'use strict';
-
- var _formParser = require('./form-parser');
-
- chrome.runtime.onMessage.addListener(function (message) {
- var loginForm = (0, _formParser.getLoginForm)();
- loginForm.loginField.value = message.login;
- loginForm.passwordField.value = message.password;
- loginForm.form.submit();
- });
-
- },{"./form-parser":2}],2:[function(require,module,exports){
- 'use strict';
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- function getLoginForm() {
- var loginForm = {};
- Array.from(document.forms).forEach(function (form) {
- var i = 0;
- var inputs = Array.from(document.querySelectorAll('input'));
- inputs.forEach(function (node) {
- if (node.type === 'password') {
- loginForm.form = form;
- loginForm.passwordField = node;
- if (i > 0) {
- loginForm.loginField = inputs[i - 1];
- }
- }
- i++;
- });
- });
- return loginForm;
- }
-
- exports.getLoginForm = getLoginForm;
-
- },{}]},{},[1]);
|