Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- document.elementForOPID = q;
- function t(a, b, c, d) {
- var e;
- u ? (e = document.createEvent('KeyboardEvent'),
- e.initKeyEvent(b, !0, !1, null, !1, !1, !1, !1, c, d)) : (e = a.ownerDocument.createEvent('Events'),
- e.initEvent(b, !0, !1),
- e.charCode = d,
- e.keyCode = c,
- e.which = c,
- e.srcElement = a,
- e.target = a);
- return e
- }
- function aa(a) {
- var b = a.value;
- w(a, !1);
- a.dispatchEvent(t(a, 'keydown', 0, 0));
- a.dispatchEvent(t(a, 'keypress', 0, 0));
- a.dispatchEvent(t(a, 'keyup', 0, 0));
- if ('' === a.value || a.dataset['com.agilebits.onepassword.initialValue'] && a.value === a.dataset['com.agilebits.onepassword.initialValue'])
- a.value = b
- }
- function ba(a) {
- var b = a.value
- , c = a.ownerDocument.createEvent('HTMLEvents')
- , d = a.ownerDocument.createEvent('HTMLEvents');
- a.dispatchEvent(t(a, 'keydown', 0, 0));
- a.dispatchEvent(t(a, 'keypress', 0, 0));
- a.dispatchEvent(t(a, 'keyup', 0, 0));
- d.initEvent('input', !0, !0);
- a.dispatchEvent(d);
- c.initEvent('change', !0, !0);
- a.dispatchEvent(c);
- a.blur();
- if ('' === a.value || a.dataset['com.agilebits.onepassword.initialValue'] && a.value === a.dataset['com.agilebits.onepassword.initialValue'])
- a.value = b
- }
- function y(a, b, c) {
- var d = null;
- a && a.attributes && (d = (d = a.attributes[b]) ? d.value : null);
- return (a = d) && c.test(a)
- }
- function ca() {
- var a = RegExp('((\\b|_|-)pin(\\b|_|-)|password|passwort|kennwort|passe|contraseña|senha|密码|adgangskode|hasło|wachtwoord)', 'i');
- return Array.prototype.slice.call(z(document, "input[type='text']")).filter(function(b) {
- return b.value && a.test(b.value)
- }, this)
- }
- function da() {
- ca().forEach(function(a) {
- aa(a);
- a.click && a.click();
- ba(a)
- })
- }
- var B = [/^\W*log\W*[oi]n\W*$/i, /log\W*[oi]n (?:securely|now)/i, /^\W*sign\W*[oi]n\W*$/i, 'continue', 'submit', 'weiter', 'accès', 'вход', 'connexion', 'entrar', 'anmelden', 'accedi', 'valider', '登录', 'लॉग इन करें'];
- window.LOGIN_TITLES = B;
- var ea = ['change password', 'save changes'];
- window.CHANGE_PASSWORD_TITLES = ea;
- var C = ['already have an account', 'sign in with'];
- window.LOGIN_RED_HERRING_TITLES = C;
- var D = 'register;sign up;signup;join;create my account;регистрация;inscription;regístrate;cadastre-se;registrieren;registrazione;注册;साइन अप करें'.split(';');
- window.REGISTER_TITLES = D;
- var fa = 'search find поиск найти искать recherche suchen buscar suche ricerca procurar 検索'.split(' ');
- window.SEARCH_TITLES = fa;
- var E = 'forgot geändert vergessen hilfe changeemail español'.split(' ');
- window.FORGOT_PASSWORD_TITLES = E;
- var F = ['remember me', 'rememberme', 'keep me signed in'];
- window.REMEMBER_ME_TITLES = F;
- var ga = ['back', 'назад'];
- window.BACK_TITLES = ga;
- function I(a, b, c) {
- var d;
- if (!a || '' == a)
- return !1;
- d = a.replace(/^\s+/m, '').replace(/\s+$/m, '').replace(/\s\s+/, ' ').toLowerCase().trim();
- b = b.some(function(b) {
- return 'function' === typeof b.test ? b.test(a) || b.test(d) : 0 <= d.indexOf(b)
- });
- var e = !1;
- c && (e = c.some(function(b) {
- return 'function' === typeof b.test ? b.test(a) || b.test(d) : 0 <= d.indexOf(b)
- }));
- return b && !e
- }
- function ha(a) {
- var b, c, d;
- if (!a || '' == a)
- return !1;
- b = 'submit';
- 0 === b.constructor.toString().indexOf('function String()') && (b = [],
- b.push('submit'));
- a = a.replace(/^\s+/m, '').replace(/\s+$/m, '').replace(/\s\s+/, ' ').toLowerCase().trim();
- c = 0;
- for (d = b.length; c < d; c++)
- if (0 <= a.indexOf(b[c].toLowerCase()))
- return !0;
- return !1
- }
- function J(a) {
- return a.textContent || a.innerText
- }
- function ia(a) {
- var b = null;
- a && (b = a.toLowerCase().replace(/\s/mg, '').replace(/[~`!@$%^&*()\-_+=:;'"\[\]|\\,<.>\/?]/mg, ''),
- b = 0 < b.length ? b : null);
- return b
- }
- function K(a) {
- var b = null;
- a && (b = a.replace(/^\s+|\s+$|\r?\n.*$/mg, '').replace(/\s{2,}/, ' '),
- b = 0 < b.length ? b : null);
- return b
- }
- function ja(a, b) {
- var c;
- c = '';
- 3 === b.nodeType ? c = b.nodeValue : 1 === b.nodeType && (c = J(b));
- (c = K(c)) && a.push(c)
- }
- function L(a) {
- return a && void 0 !== a ? ka(a, 'select option input form textarea button table iframe body head script'.split(' ')) : !0
- }
- function ma(a, b, c) {
- var d;
- for (c || (c = 0); a && a.previousSibling; ) {
- a = a.previousSibling;
- if (L(a))
- return;
- ja(b, a)
- }
- if (a && 0 === b.length) {
- for (d = null; !d; ) {
- a = a.parentElement || a.parentNode;
- if (!a)
- return;
- for (d = a.previousSibling; d && !L(d) && d.lastChild; )
- d = d.lastChild
- }
- L(d) || (ja(b, d),
- 0 === b.length && ma(d, b, c + 1))
- }
- }
- function ka(a, b) {
- var c;
- if (!a)
- return !1;
- c = a ? (a.tagName || '').toLowerCase() : '';
- return b.constructor == Array ? 0 <= b.indexOf(c) : c === b
- }
- function M(a) {
- for (var b = a, c = (a = a.ownerDocument) ? a.defaultView : {}, d; b && b !== a; ) {
- d = c.getComputedStyle && b instanceof Element ? c.getComputedStyle(b, null) : b.style;
- if (!d)
- return !0;
- if ('none' === d.display || 'hidden' == d.visibility)
- return !1;
- b = b.parentNode
- }
- return b === a
- }
- function na(a) {
- var b = a.ownerDocument.documentElement, c = a.getBoundingClientRect(), d = b.scrollWidth, e = b.scrollHeight, g = c.left - b.clientLeft, b = c.top - b.clientTop, f;
- if (!M(a) || !a.offsetParent || 10 > a.clientWidth || 10 > a.clientHeight)
- return !1;
- var l = a.getClientRects();
- if (0 === l.length)
- return !1;
- for (var k = 0; k < l.length; k++)
- if (f = l[k],
- f.left > d || 0 > f.right)
- return !1;
- if (0 > g || g > d || 0 > b || b > e)
- return !1;
- for (c = a.ownerDocument.elementFromPoint(g + (c.right > window.innerWidth ? (window.innerWidth - g) / 2 : c.width / 2), b + (c.bottom > window.innerHeight ? (window.innerHeight - b) / 2 : c.height / 2)); c && c !== a && c !== document; ) {
- if (c.tagName && 'string' === typeof c.tagName && 'label' === c.tagName.toLowerCase() && a.labels && 0 < a.labels.length)
- return 0 <= Array.prototype.slice.call(a.labels).indexOf(c);
- c = c.parentNode
- }
- return c === a
- }
- function oa(a) {
- return pa && M(a) ? -1 !== 'email text password number tel url'.split(' ').indexOf(a.type || '') : !1
- }
- function qa(a) {
- var b;
- if (!a)
- return !1;
- a: {
- var c;
- if (a && !(2 < a.length))
- for (c = 0; c < a.length; c++)
- if (b = a.elements[c],
- b.type && 'search' == b.type.toLowerCase()) {
- b = !0;
- break a
- }
- b = !1
- }
- if (b)
- return !0;
- b = /(login|signin|log_in)/i;
- if (y(a, 'name', b) || y(a, 'id', b) || y(a, 'action', b))
- return !1;
- b = /(search|[\/?&]find)/i;
- return y(a, 'name', b) || y(a, 'id', b) ? !0 : y(a, 'action', b)
- }
- function N(a) {
- var b, c, d;
- if (!a)
- return '';
- b = '';
- c = 0;
- for (d = a.length; c < d; c++)
- b += String.fromCharCode(150 ^ a[c]);
- return b
- }
- function O(a) {
- return a ? a.getAttribute('id') + '/' + a.getAttribute('name') + '/' + a.getAttribute('action') : '<null>'
- }
- function ra(a) {
- if (!a || 'form' === a.tagName.toLowerCase())
- return a;
- if (void 0 !== a.form)
- return a.form;
- for (var b, c = a.ownerDocument.forms, d = 0; d < c.length; d++)
- if (b = Array.prototype.slice.call(c[d].getElementsByTagName(a.tagName)),
- -1 !== b.indexOf(a))
- return c[d];
- return null
- }
- function sa(a) {
- return Array.prototype.slice.call(z(a, 'input, select, button'))
- }
- function q(a) {
- var b;
- if (void 0 === a || null === a)
- return null;
- try {
- var c = sa(document)
- , d = c.filter(function(b) {
- return b.opid == a
- });
- if (0 < d.length)
- b = d[0],
- 1 < d.length && console.warn('More than one element found with opid ' + a);
- else {
- var e = parseInt(a.split('__')[1], 10);
- isNaN(e) || (b = c[e])
- }
- } catch (g) {
- console.error('An unexpected error occurred: ' + g)
- } finally {
- return b
- }
- }
- ;var va = new function() {
- function a(a) {
- if (!a || 0 >= a.length)
- return !1;
- for (var b = 0, c = 0; c < a.length; c++)
- '' != a[c].value && b++;
- return 0 < b
- }
- function b(a) {
- if (!a)
- return null;
- var b = a ? (a.tagName || '').toLowerCase() : ''
- , c = {};
- c.name = a.name;
- c.value = a.value;
- c.id = a.id;
- c.visible = M(a);
- 'select' === b ? c.type = 'S' : 'input' === b ? (b = a.type.toLowerCase(),
- 'text' === b ? c.type = 'T' : 'tel' === b ? c.type = 'TEL' : 'email' === b ? c.type = 'E' : 'url' === b ? c.type = 'U' : 'number' === b ? c.type = 'N' : 'range' === b ? c.type = 'RNG' : 'password' === b ? c.type = 'P' : 'checkbox' === b ? (c.type = 'C',
- c.value = a.checked ? '✓' : '') : 'radio' === b ? (c.type = 'R',
- c.value = a.checked ? '1' : '0') : 'submit' === b ? c.type = 'I' : 'button' === b && (c.type = 'B')) : 'textarea' === b && (c.type = 'A');
- return c
- }
- function c(a) {
- if (!a)
- return 0;
- for (var b = 0, c = 0; c < a.length; c++) {
- var d = a.elements[c];
- if (ka(d, 'input')) {
- var e = d.type.toLowerCase()
- , g = /(text|password|email|url|number|range)/i;
- e && e.match(g) && '' != d.value && b++
- } else
- ka(d, 'textarea') && '' != d.value && b++
- }
- return b
- }
- function d(c, d, e) {
- var f = {
- shouldSave: !1,
- fields: null
- }
- , l = !1
- , s = [];
- e && c && 0 < c.length && (f.form = c[0].form);
- for (var H = [], v = [], n = 0; n < c.length; n++) {
- var h = b(c[n]);
- h.type && s.push(h);
- 'T' != h.type && 'E' != h.type || H.push(h);
- 'P' === h.type && 0 < h.value.length && v.push(h)
- }
- if (e && !d)
- for (n = 0,
- c = k.length; n < c; n++)
- h = b(k[n]),
- h.type && '' !== h.value && 0 == s.filter(function(a) {
- return a.type !== h.type || a.value !== h.value || a.name !== h.name || a.id !== h.id ? !1 : !0
- }).length && s.push(h);
- if (0 < H.length) {
- var X = null
- , r = null
- , la = null
- , h = null
- , za = /user[_-]?name/i
- , n = 0;
- for (c = H.length; n < c; n++)
- h = H[n],
- h.name && 'username' === h.name ? X = h : h.name.match(za) || h.id.match(za) ? X = h : h.type && 'E' == h.type && '' != h.value ? r = h : !h.type || 'T' != h.type && 'U' != h.type || '' == h.value || (la = h);
- X ? X.designation = 'username' : r ? r.designation = 'username' : la && (la.designation = 'username')
- }
- 0 < v.length && (v.sort(function(a, b) {
- return a.value.length - b.value.length
- }),
- v[0].designation = 'password',
- l = !0);
- !d && 0 < s.length ? f.shouldSave = !0 : e ? l && (f.shouldSave = !0) : l && g(null) && a(s) && (f.shouldSave = !0);
- f.fields = s;
- return f
- }
- function e(a, b) {
- k = [];
- for (var c = document.getElementsByTagName('input'), e = 0, f = c.length; e < f; e++)
- c[e].form || k.push(c[e]);
- e = a ? a.elements : k;
- f = d(e, b, a ? !0 : !1);
- if (f.shouldSave) {
- for (var g = f.form, l = {}, v = [], n = [], c = {}, h = e.length - 1; 0 <= h; h--)
- e[h].form && -1 === v.indexOf(e[h].form) && v.push(e[h].form),
- e[h].ownerDocument && -1 === n.indexOf(e[h].ownerDocument) && n.push(e[h].ownerDocument);
- 1 === v.length && 1 === n.length && v[0].ownerDocument === n[0] ? (c.location = v[0].ownerDocument.URL,
- c.title = v[0].ownerDocument.domain) : 1 === n.length ? (c.location = n[0].URL,
- c.title = n[0].domain) : (c.location = window.location.href,
- c.title = window.document.title);
- l.type_name = 'webforms.WebForm';
- l.secureContents = {
- fields: f.fields
- };
- g && 'string' === typeof g.getAttribute('action') && '' !== g.getAttribute('action') && (l.secureContents.htmlAction = ta(g.getAttribute('action')));
- g && 'string' === typeof g.getAttribute('id') && '' !== g.getAttribute('id') && (l.secureContents.htmlID = g.getAttribute('id'));
- g && 'string' === typeof g.getAttribute('name') && '' !== g.getAttribute('name') && (l.secureContents.htmlName = g.getAttribute('name'));
- g && 'string' === typeof g.getAttribute('method') && '' !== g.getAttribute('method') && (l.secureContents.htmlMethod = g.getAttribute('method'));
- l.overview = {};
- e = new ua(l);
- e.setTitle(c.title);
- e.a.overview.location = c.location;
- c = e
- } else
- c = null;
- return c
- }
- function g(a) {
- a = Array.prototype.slice.call(a ? a.elements : k);
- for (var b, c, d = 0; d < a.length; d++)
- if (c = a[d].value || '',
- b = a[d].getAttribute('value') || '',
- c != b)
- return !0;
- return !1
- }
- function f(a) {
- for (var c = {}, d = 0; d < a.length; d++) {
- var e = b(a[d]);
- e.type && '' !== e.value && (c[e ? e.id + '/' + e.name + '/' + e.type : '<null>'] = e.value)
- }
- return c
- }
- var l = {}
- , k = null;
- return {
- k: function() {
- var a;
- a = null;
- var b = document.forms;
- if (!b || 1 > b.length)
- a = null;
- else {
- for (var d = [], f = 0, k = b.length; f < k; f++) {
- var l = b[f];
- g(l) && (d[d.length] = l)
- }
- b = d;
- for (d = 0; d < b.length; d++)
- (f = b[d]) && M(f) && (null == a || c(f) > c(a)) && (a = f)
- }
- return e(a, !1)
- },
- m: e,
- g: function() {
- var a = document.getElementsByTagName('input');
- k = [];
- for (var b = [], c = 0, d = a.length; c < d; c++) {
- var e = a[c].form;
- e ? l[O(e)] ? -1 === b.indexOf(O(e)) && b.push(O(e)) : l[O(e)] = f(e.elements) : k.push(a[c])
- }
- 0 < k.length && (l[O(null)] = f(k))
- }
- }
- }
- ;
- var wa = new function() {
- function a(a, b) {
- if (!a || 0 == a.length)
- return !1;
- a = a.toLowerCase();
- var c, f = b.length;
- for (c = 0; c < f; c++)
- if (-1 !== a.indexOf(b[c]))
- return !0;
- return !1
- }
- function b() {
- var a = document.forms, b, c;
- if (!a || 1 > a.length) {
- a: {
- b = document.getElementsByTagName('input');
- c = 0;
- for (a = b.length; c < a; c++) {
- var f = b[c];
- if ('text' === f.type || 'email' === f.type || 'password' === f.type) {
- b = !0;
- break a
- }
- }
- b = !1
- }
- return b
- }
- b = 0;
- for (c = a.length; b < c; b++) {
- var f = a[b], l;
- if (l = f && M(f))
- if (l = !qa(f))
- if (l = 0 < f.elements.length)
- a: {
- if (f && !(1 > f.elements)) {
- l = 0;
- for (var k = f.elements.length; l < k; l++) {
- var p = f.elements[l];
- if ('text' === p.type || 'email' === p.type || 'password' === p.type) {
- l = !0;
- break a
- }
- }
- }
- l = !1
- }
- if (l)
- return !0
- }
- a = document.getElementsByTagName('input');
- b = 0;
- for (c = a.length; b < c; b++)
- if (f = a[b],
- !f.form && ('password' === f.type || 'text' === f.type && M(f)))
- return !0;
- return !1
- }
- var c = ['change password', 'new password'];
- return {
- h: function() {
- var d = b(), e = d && (a(document.title, c) || a(J(document.body), c) ? !0 : !1), g;
- g = 0;
- for (var f = document.getElementsByTagName('input'), l = 0, k = f.length; l < k; l++) {
- var p = f[l], m;
- m = p && p.type ? 'password' == p.type.toLowerCase() : void 0;
- !m || p.form && !M(p.form) || 0 < p.value.length || g++
- }
- f = 50;
- l = z(document, 'input[type=password]');
- k = 0;
- for (p = l.length; k < p; k++)
- m = l[k],
- M(m) && m.getAttribute('maxlength') && (f = Math.min(m.getAttribute('maxlength'), f));
- f = Math.max(f, 8);
- return {
- hasLoginForm: d,
- hasChangePasswordForm: e,
- hasCreditCardForm: !1,
- hasIdentityForm: !1,
- emptyPasswordFieldCount: g,
- passGenMaxLength: f,
- title: document.title || ''
- }
- }
- }
- }
- ;
- function ua(a) {
- this.a = a;
- this.b = null
- }
- ua.prototype = {
- toJSON: function() {
- return this.a
- },
- toString: function() {
- var a = 'Regular login';
- P(this) && (a = 'Change password');
- var b;
- P(this) ? b = !1 : (xa(this, 'htmlAction') || '').match(/(signup|register)/i) || (xa(this, 'htmlID') || '').match(/(signup|register)/i) ? b = !0 : (b = ya(this, ['P']),
- b = 2 != b.length ? !1 : b[0].value === b[1].value);
- b && (a = 'Registration form');
- return '[OPLogin ' + (this.n() || 'NO_UUID') + ' (' + a + ')] <' + this.location() + '>'
- },
- n: function() {
- return this.a.uuid
- },
- i: function() {
- return (this.a.secureContents || {}).fields
- },
- title: function() {
- return this.a.overview.title
- },
- setTitle: function(a) {
- this.a.overview.title = a
- },
- location: function() {
- if (this.a && this.a.overview)
- return this.a.overview.location
- }
- };
- function P(a) {
- var b = ya(a, ['P'])
- , b = b.filter(function(a) {
- return a.visible && '' !== a.value
- });
- if (2 > b.length)
- return !1;
- if (3 === b.length) {
- var c = b[0].value
- , d = b[1].value
- , e = b[2].value;
- if (c === d && c === e)
- return !1;
- var g = [];
- 0 < c.length && -1 === g.indexOf(c) && g.push(c);
- 0 < d.length && -1 === g.indexOf(d) && g.push(d);
- 0 < e.length && -1 === g.indexOf(e) && g.push(e);
- if (2 == g.length)
- return !0
- }
- if (2 === b.length)
- if (0 < ya(a, ['T', 'U', 'E']).length) {
- if (a.b)
- for (a = [a.b.textContent, a.b.value, a.b.innerText, a.b.hasAttribute('title') ? a.b.title : '', a.b.hasAttribute('alt') ? a.b.alt : ''],
- c = 0; c < a.length; c++)
- if (I(a[c], ea))
- return b[0].value === b[1].value
- } else
- return b[0].value === b[1].value;
- return !1
- }
- function ya(a, b) {
- var c = a.i();
- if (!c)
- return [];
- for (var d = [], e = 0; e < c.length; ++e) {
- var g = c[e].type;
- g && 0 <= b.indexOf(g) && d.push(c[e])
- }
- return d
- }
- function xa(a, b) {
- var c = (a.a.secureContents || {}).htmlForm;
- return c ? c[b] || '' : null
- }
- ;function Aa(a) {
- this.c = {};
- this.name = a;
- if ('object' != typeof chrome || !chrome.runtime)
- if ('object' == typeof safari && null != safari.extension) {
- var b = this;
- safari.self.addEventListener('message', function(a) {
- 'performCallback' === a.name && Ba(b, a.message.uuid, a.message.result)
- }, !1)
- } else
- 'object' === typeof self && 'object' === typeof self.port && (b = this,
- self.port.on('callback', function(a) {
- Ba(b, a.uuid, a.result)
- }))
- }
- Aa.prototype = {};
- function Ba(a, b, c) {
- var d = a.c[b];
- d && (delete a.c[b],
- d(c))
- }
- function Q(a, b, c) {
- var d = Ca
- , e = Da.e()
- , e = 'uuid-' + d.name + '-' + e
- , g = {
- uuid: e,
- command: a,
- params: b
- };
- 'object' == typeof chrome && chrome.runtime ? chrome.runtime.sendMessage(g, function(a) {
- c && c(a)
- }) : 'object' == typeof safari && null != safari.extension ? 'object' == typeof safari.extension && 'object' == typeof safari.extension.globalPage && 'object' == typeof safari.extension.globalPage.contentWindow ? safari.extension.globalPage.contentWindow.performCommand(null, a, b, function(a) {
- c && c(a)
- }) : (c && (d.c[e] = c),
- safari.self.tab.dispatchMessage('perform', g)) : 'object' === typeof self && 'object' === typeof self.port && (c && (d.c[e] = c),
- self.port && self.port.emit('perform', g))
- }
- ;function Ea(a, b) {
- Fa ? 'object' === typeof safari.application && 'object' === typeof safari.extension ? safari.extension.globalPage.contentWindow.handleMessageEvent(safari.application.activeBrowserWindow.activeTab, a, b, null) : safari.self.tab.dispatchMessage(a, b) : Ga ? chrome.runtime.sendMessage({
- name: a,
- message: b
- }) : u && self.port.emit('message', {
- name: a,
- message: b
- })
- }
- function ta(a) {
- return (a = new URL(a,window.location.href)) ? a.href : null
- }
- function Ha() {
- var a = document
- , b = null;
- try {
- b = a.querySelector(':focus')
- } catch (c) {}
- return b
- }
- function z(a, b) {
- var c = [];
- try {
- c = a.querySelectorAll(b)
- } catch (d) {}
- return c
- }
- function w(a, b) {
- if (!a)
- return !1;
- var c;
- b && (c = a.value);
- 'function' === typeof a.click && a.click();
- 'function' === typeof a.focus && a.focus();
- b && a.value !== c && (a.value = c);
- return 'function' === typeof a.click || 'function' === typeof a.focus
- }
- var Da = new function() {
- return {
- e: function() {
- function a() {
- return (65536 * (1 + Math.random()) | 0).toString(16).substring(1).toUpperCase()
- }
- return [a(), a(), a(), a(), a(), a(), a(), a()].join('')
- }
- }
- }
- ;
- var Fa = 'object' === typeof safari && safari.extension
- , Ga = 'object' === typeof chrome && chrome.runtime
- , u = 'object' === typeof self && 'object' === typeof self.port
- , Ca = new Aa('protected')
- , R = Da.e()
- , Ia = null
- , Ja = 0;
- function Ka(a, b) {
- switch (a) {
- case 'getPageDetails':
- La(b.token);
- break;
- case 'manualSave':
- Ma(b.token);
- break;
- case 'executeFillScript':
- if (R === b.documentUUID || 'all' === b.documentUUID) {
- var c;
- Ia = b.itemType;
- b.nakedDomains && (c = Array.isArray(b.nakedDomains) ? b.nakedDomains : 'string' === typeof b.nakedDomains ? [b.nakedDomains] : [JSON.stringify(b.nakedDomains)]);
- 'fillLogin' === Ia || Array.isArray(c) && 0 < c.length ? Q('canFillLoginOnHostname', {
- nakedDomains: c,
- hostname: window.location.hostname
- }, function(a) {
- !0 === a.allowed && S(b)
- }) : S(b)
- }
- break;
- case 'legacy_executeFillScript':
- R !== b.documentUUID && 'all' !== b.documentUUID || S(b);
- break;
- case 'collectFields':
- Na(b);
- break;
- case 'presentFields':
- Oa();
- break;
- case 'welcomeCommand':
- Pa(b);
- break;
- case 'authCommand':
- Qa(b);
- break;
- case 'checkForGoAndFill':
- T = !1,
- Ja = 0,
- U()
- }
- }
- function Pa(a) {
- var b = document.getElementById('xpc');
- if (b) {
- var c = document.createElement('li');
- '' === c.textContent ? c.textContent = JSON.stringify(a) : c.innerText = JSON.stringify(a);
- b.appendChild(c)
- }
- }
- function Qa(a) {
- var b = CustomEvent;
- a = {
- name: a.name,
- params: a.params
- };
- a = u ? cloneInto(a, window.document) : a;
- b = new b('ExtensionAuthCommand',{
- bubbles: !1,
- cancelable: !1,
- detail: a
- });
- document.dispatchEvent(b)
- }
- 'https://agilebits.com/browsers/auth.html' === window.location.href && document.addEventListener('ExtensionAuthResponse', function(a) {
- a = a.detail;
- Q(a.name, a.params)
- });
- 'https://agilebits.com/browsers/welcome.html' === window.location.href && document.addEventListener('click', function(a) {
- if ('authReconnect' === a.target.id)
- return Q('reauthorize', {}),
- !1
- });
- function Ma(a) {
- var b, c;
- if (b = va.k())
- c = V(window.document, R),
- Q('manualSaveResults', {
- login: b.a,
- collectedDocument: c,
- token: a,
- documentUUID: R,
- tabId: void 0
- }, null)
- }
- function Na(a) {
- var b = a.fillContextIdentifier;
- da();
- a = V(window.document, R);
- var c = new URL(window.location.href);
- c && c.hostname || 'about:accounts' === window.location.href ? Q('collectFieldsResult', {
- documentUUID: R,
- url: window.location.href,
- fields: a,
- fillContextIdentifier: b
- }, null) : console.warn('Failed to create URL object for string <' + window.location.href + '>')
- }
- function Ra(a, b, c) {
- function d(a) {
- return a && !a.dataset.p && M(a) ? 0 <= ['text', 'email', 'number', 'tel', 'url'].indexOf(a.type.toLowerCase()) : !1
- }
- if (c && 'object' === typeof c && 0 !== c.length) {
- var e, g = a['helper-capable-of-press-enter-key'];
- elementsToFocus = [];
- if (a && a.focusSelector) {
- elementsToFocus = Array.prototype.slice.call(z(document, a.focusSelector));
- var f = [];
- for (e = 0; e < elementsToFocus.length; e++)
- c.indexOf(elementsToFocus[e]) && f.push(elementsToFocus[e]);
- 0 < f.length && (elementsToFocus = f)
- }
- if (0 < elementsToFocus.length)
- for (e = 0; e < elementsToFocus.length; e++)
- w(elementsToFocus[e], !0);
- else
- elementsToFocus = c;
- c = elementsToFocus[elementsToFocus.length - 1];
- for (e = elementsToFocus.length - 1; 0 <= e; e--)
- if (null !== elementsToFocus[e] && na(elementsToFocus[e])) {
- if ('password' === elementsToFocus[e].type.toLowerCase()) {
- c = elementsToFocus[e];
- break
- }
- !d(c) && d(elementsToFocus[e]) && (c = elementsToFocus[e])
- }
- if (null !== c && (document.activeElement !== c && w(c, !0),
- a && a.submit))
- if ((a = z(document, a.clickSelector)) && 0 < a.length)
- for (e = 0,
- b = a.length; e < b; e++)
- a[e].click();
- else
- 'password' === c.type.toLowerCase() && Sa(c, g, b)
- } else
- console.warn('Autosubmit was called without a valid collection of filled fields. Ignoring.')
- }
- function La(a) {
- var b = wa.h();
- Q('getPageDetailsResponse', {
- pageDetails: b,
- token: a
- }, null)
- }
- var Ta = null
- , T = !1;
- function U() {
- T || (10 < Ja ? T = !0 : (Ja++,
- 0 == document.querySelectorAll('input[type=text],input[type=password]').length ? Ta = setTimeout(U, 300) : (T = !0,
- Q('checkForGoAndFill', {
- url: window.location.href,
- documentUUID: R
- }))))
- }
- function Ua() {
- var a;
- void 0 === a && (a = window.location.hostname);
- return Va(a) || /^(?:[^.]+\.)*(?:agilebits).com$/i.test(a)
- }
- function Va(a) {
- void 0 === a && (a = window.location.hostname);
- return /^(?:[^.]+\.)*(?:1password|b5dev|b5staging|b5test|b5local).com$/i.test(a)
- }
- function Wa() {
- document.addEventListener('B5SignInSucceeded', function(a) {
- Q('B5SignInSucceeded', a.detail)
- })
- }
- function Xa(a) {
- document.addEventListener('B5WebReady', function(b) {
- a && b && b.detail && b.detail.capabilities && b.detail.capabilities.CustomAutosave && (Ya(),
- Wa())
- })
- }
- if ('object' == typeof safari && void 0 !== safari.self)
- safari.self.addEventListener('message', function(a) {
- Ka(a.name, a.message)
- }, !1);
- else if ('object' == typeof chrome && chrome.runtime)
- chrome.runtime.onMessage.addListener(function(a) {
- Ka(a.name, a.message)
- });
- else if ('object' === typeof self && 'object' === typeof self.port)
- self.port.on('message', function(a) {
- Ka(a.name, a.message)
- });
- 0 === window.location.protocol.indexOf('http') && (setTimeout(function() {
- va.g();
- Za(!0);
- Ua() && document.body && 'object' === typeof document.body.dataset && (document.body.dataset.onepasswordExtensionVersion = 4060390);
- Va() && Q('canAddB5Account', {}, function(a) {
- var b = {
- capabilities: {},
- version: 4060390
- };
- a = !!a.capable;
- Xa(a);
- b.capabilities.CustomAutosave = a;
- document.dispatchEvent(new CustomEvent('B5OPXReady',{
- bubbles: !1,
- cancelable: !1,
- detail: b
- }))
- })
- }, 200),
- window.addEventListener('pageshow', function() {
- Ta = setTimeout(U, 200)
- }, !1),
- setTimeout(function() {
- T || (clearTimeout(Ta),
- U())
- }, 2E3));
- var $a = !0
- , pa = !0
- , ab = !0;
- document.com_agilebits_onepassword_fill = S;
- function bb(a) {
- var b = null;
- return a ? 0 === a.indexOf('https://') && 'http:' === document.location.protocol && (b = document.querySelectorAll('input[type=password]'),
- 0 < b.length && (confirmResult = confirm('1Password warning: This is an unsecured HTTP page, and any information you submit can potentially be seen and changed by others. This Login was originally saved on a secure (HTTPS) page.\n\nDo you still wish to fill this login?'),
- 0 == confirmResult)) ? !0 : !1 : !1
- }
- function S(a) {
- var b, c = [], d = a.properties, e = 1, g = [];
- d && d.delay_between_operations && (e = d.delay_between_operations);
- if (!bb(a.savedURL)) {
- var f = function(a, b) {
- var d = a[0];
- if (void 0 === d)
- b();
- else {
- if ('delay' === d.operation || 'delay' === d[0])
- e = d.parameters ? d.parameters[0] : d[1];
- else {
- if (d = cb(d))
- for (var m = 0; m < d.length; m++)
- -1 === g.indexOf(d[m]) && g.push(d[m]);
- c = c.concat(g.map(function(a) {
- return a && a.hasOwnProperty('opid') ? a.opid : null
- }))
- }
- setTimeout(function() {
- f(a.slice(1), b)
- }, e)
- }
- };
- $a = ab = !0;
- if (b = a.options)
- b.hasOwnProperty('animate') && (pa = b.animate),
- b.hasOwnProperty('markFilling') && ($a = b.markFilling);
- if ((b = a.metadata) && b.hasOwnProperty('action'))
- switch (b.action) {
- case 'fillPassword':
- $a = !1;
- break;
- case 'fillLogin':
- ab = !1
- }
- a.hasOwnProperty('script') && (b = a.script,
- f(b, function() {
- a.hasOwnProperty('autosubmit') && 'function' == typeof Ra && (!a.itemType || 'fillLogin' === a.itemType) && 0 < g.length && setTimeout(function() {
- Ra(a.autosubmit, d.allow_clicky_autosubmit, g)
- }, 250);
- 'object' == typeof Ca && Q('fillItemResults', {
- documentUUID: R,
- fillContextIdentifier: a.fillContextIdentifier,
- usedOpids: c
- }, function() {
- Ia = null
- })
- }))
- }
- }
- var kb = {
- fill_by_opid: db,
- fill_by_query: eb,
- click_on_opid: fb,
- click_on_query: gb,
- touch_all_fields: hb,
- simple_set_value_by_query: ib,
- focus_by_opid: jb,
- delay: null
- };
- function cb(a) {
- var b;
- if (a.hasOwnProperty('operation') && a.hasOwnProperty('parameters'))
- b = a.operation,
- a = a.parameters;
- else if ('[object Array]' === Object.prototype.toString.call(a))
- b = a[0],
- a = a.splice(1);
- else
- return null;
- return kb.hasOwnProperty(b) ? kb[b].apply(this, a) : null
- }
- function db(a, b) {
- var c;
- return (c = q(a)) ? (lb(c, b),
- [c]) : null
- }
- function eb(a, b) {
- var c;
- c = z(document, a);
- return Array.prototype.map.call(Array.prototype.slice.call(c), function(a) {
- lb(a, b);
- return a
- }, this)
- }
- function ib(a, b) {
- var c, d = [];
- c = z(document, a);
- Array.prototype.forEach.call(Array.prototype.slice.call(c), function(a) {
- a.disabled || a.f || a.readOnly || void 0 === a.value || (a.value = b,
- d.push(a))
- });
- return d
- }
- function jb(a) {
- (a = q(a)) && w(a, !0);
- return null
- }
- function fb(a) {
- return (a = q(a)) ? w(a, !1) ? [a] : null : null
- }
- function gb(a) {
- a = z(document, a);
- return Array.prototype.map.call(Array.prototype.slice.call(a), function(a) {
- w(a, !0);
- return [a]
- }, this)
- }
- function hb() {
- da()
- }
- ;function Za(a) {
- window.document.addEventListener('submit', mb, a);
- window.document.addEventListener('keydown', nb, a);
- window.document.addEventListener('click', ob, a)
- }
- function Ya() {
- window.document.removeEventListener('submit', mb, !0);
- window.document.removeEventListener('keydown', nb, !0);
- window.document.removeEventListener('click', ob, !0)
- }
- function mb(a) {
- (a = a ? a.target : this) || (a = ra(a));
- W(a, null);
- return !1
- }
- var Y = B.concat(D).concat(ea);
- function ob(a) {
- var b = a ? a.target : this;
- if (!1 !== a.j) {
- var c = function(a) {
- for (var b = a.ownerDocument.querySelectorAll('[role=button]'), c, f = 0; f < b.length; f++)
- if (c = Array.prototype.slice.call(b[f].getElementsByTagName(a.tagName)),
- -1 !== c.indexOf(a))
- return b[f];
- return null
- };
- if (a = function(a) {
- if (-1 !== ['button', 'input'].indexOf(a.tagName.toLowerCase())) {
- if ('button' === a.tagName.toLowerCase() && !a.hasAttribute('type') || 'button' === a.type.toLowerCase())
- if (I(a.textContent, Y, C) || I(a.value, Y, C) || a.hasAttribute('aria-label') && I(a.getAttribute('aria-label'), Y, C))
- return a;
- if (-1 !== ['submit', 'image'].indexOf(a.type.toLowerCase()))
- return a
- } else {
- var b;
- a && void 0 !== a.getAttribute ? (b = a.getAttribute('data-action'),
- b = ha(b)) : b = !1;
- b || (b = J(a) || a.value,
- b = 'div' === a.tagName.toLowerCase() && a.classList.contains('button') && (b && I(b, Y, C) || a.hasAttribute('aria-label') && I(a.getAttribute('aria-label'), Y, C)) ? !0 : !1);
- if (b)
- return a
- }
- a: {
- b = 3;
- for (var c = null; a && a !== document && 0 <= b; )
- if (c = J(a) || a.value || c,
- -1 !== ['a', 'button'].indexOf(a.tagName.toLowerCase())) {
- if (a.hasAttribute('type') && 'submit' === a.type.toLowerCase() || c && I(c, Y, C) || a.hasAttribute('aria-label') && I(a.getAttribute('aria-label'), Y, C))
- break a;
- break
- } else
- a = a.parentNode,
- b--;
- a = null
- }
- return a
- }(b))
- c = ra(b),
- W(c, a);
- else if (b = c(b))
- if (0 <= (b.getAttribute('title') && Y.indexOf(b.getAttribute('title').toLowerCase())) || b.getAttribute('alt') && 0 <= Y.indexOf(b.getAttribute('alt').toLowerCase()))
- (c = ra(b)) ? W(c, b) : W(null, b)
- }
- }
- function nb(a) {
- 13 !== a.keyCode || 'text' !== a.target.type && 'password' !== a.target.type && 'email' !== a.target.type || (a.target.form ? W(a.target.form, null) : W(null, null))
- }
- function W(a, b) {
- if (-1 === window.location.href.indexOf('chrome-extension://') && -1 === window.location.href.indexOf('safari-extension://')) {
- for (var c = document.getElementsByTagName('meta'), d = 0; d < c.length; d++)
- if ('com.agilebits.onepassword.autosave' === c[d].name && 'no' === c[d].content)
- return;
- if (!b || !b.hasAttribute('aria-controls'))
- if (c = document.querySelectorAll('input[type="password"]'),
- 0 !== c.length) {
- var e = va.m(a, !0);
- e && (e.b = b);
- if (null !== e && !P(e)) {
- if (a && a.opfilled)
- return;
- if (!a) {
- for (var g = null, f = !1, d = 0; d < c.length; d++)
- g = c[d],
- /^\d{3,4}$/.test(g.value) || g.value == g.getAttribute('value') || (f = !0);
- if (!f)
- return
- }
- }
- if (e) {
- var l = P(e) ? 'change-password' : 'auto-save'
- , k = e.a
- , p = V(window.document, R);
- Ya();
- setTimeout(function() {
- Q('autosave', {
- login: k,
- collectedDocument: p,
- context: l,
- location: window.location.href
- })
- }, 50);
- setTimeout(Za, 1E3, !0)
- }
- }
- }
- }
- ;function pb() {}
- function qb() {
- var a = document.createEvent(N([194, 243, 238, 226, 211, 224, 243, 248, 226]));
- a[N([255, 248, 255, 226, 194, 243, 238, 226, 211, 224, 243, 248, 226])](N([226, 243, 238, 226, 223, 248, 230, 227, 226]), !0, !1, null, N([156]), 9, 'en-US');
- return a
- }
- function rb(a) {
- if (!a)
- return !1;
- var b = a.getAttribute('action');
- if (!b || '' == b)
- return !1;
- if (!a.onsubmit) {
- if (a.onkeypress || a.onkeydown)
- return !1;
- for (b = 0; b < a.elements.length; ++b) {
- var c = a.elements[b];
- if (c.type && 'password' === c.type.toLowerCase() && (c.onkeypress || c.onkeydown))
- return !1
- }
- }
- b = document.createEvent('UIEvent');
- b.initEvent('submit', !0, !0, window, 1);
- a.dispatchEvent(b);
- a.submit();
- return !0
- }
- function sb(a, b) {
- if (!rb(b)) {
- var c = 0, d = null, e, g;
- if (b)
- for (e = 0; e < b.elements.length; ++e) {
- var f = b.elements[e];
- g = (f.type || '').toLowerCase();
- if ('button' == Z(f) || 'submit' == g || 'button' == g)
- if (g = (f.type || '').toLowerCase(),
- g = 'submit' === g || 'button' === g || 'button' === Z(f) ? 0 <= B.indexOf((f.value || '').toLowerCase()) : void 0,
- g) {
- c = 1;
- d = f;
- break
- } else {
- if (g = !(0 > ['submit', 'button'].indexOf((f.type || '').toLowerCase()) ? 0 : 0 <= D.indexOf(f.value.toLowerCase()) || f.alt && 0 <= D.indexOf(f.alt.toLowerCase())) && !(0 > ['submit', 'button'].indexOf((f.type || '').toLowerCase()) ? 0 : 0 <= fa.indexOf(f.value.toLowerCase()) || f.alt && 0 <= fa.indexOf(f.alt.toLowerCase()))) {
- g = f;
- if (0 > ['submit', 'button'].indexOf((g.type || '').toLowerCase()))
- g = !1;
- else {
- var l = (ia(g.value) || '').toLowerCase();
- 0 <= ga.indexOf(l) ? g = !0 : (g = (ia(g.alt) || '').toLowerCase(),
- g = 0 <= ga.indexOf(g) ? !0 : !1)
- }
- g = !g
- }
- g && (c += 1,
- d = f)
- }
- }
- if (0 === c && b)
- for (l = document.getElementsByTagName('input'),
- e = 0,
- g = l.length; e < g; ++e)
- if (f = l[e],
- 'image' == f.type.toLowerCase() && f && 'image' === (f.type || '').toLowerCase() && (f.name && 0 <= B.indexOf(f.name.toLowerCase()) || f.alt && 0 <= B.indexOf(f.alt.toLowerCase()) || f.value && 0 <= B.indexOf(f.value.toLowerCase()) || f.src && I(f.src, B))) {
- c = 1;
- d = f;
- break
- }
- if (0 === c && b) {
- var k;
- e = tb(a, b);
- f = 0;
- for (g = e.length; f < g; f++)
- if (l = e[f],
- ub(l)) {
- k = l;
- break
- }
- k && (c = 1,
- d = k)
- }
- if (0 === c && b)
- for (k = b.getElementsByTagName('img'),
- e = 0; e < k.length; ++e) {
- g = k[e];
- f = g.parentElement || g.parentNode;
- if (l = 'a' === Z(f))
- l = (g && 'img' === Z(g) ? I(g.src, B) || g.title && 0 <= B.indexOf(g.title.toLowerCase()) || g.alt && 0 <= B.indexOf(g.alt.toLowerCase()) ? !0 : !1 : !1) || ub(f);
- if (l) {
- c = 1;
- d = f;
- break
- }
- }
- if (1 === c)
- if ('a' === Z(d))
- $(d, 'mousedown'),
- $(d, 'mouseup'),
- $(d, 'click');
- else {
- if (d.onclick)
- d.onclick();
- d.click()
- }
- }
- }
- function vb(a, b, c) {
- setTimeout(function() {
- a.dispatchEvent(b)
- }, c)
- }
- function wb() {
- var a = Ha(), b;
- if (!(b = !a || 'input' !== a.tagName.toLowerCase() || 'password' !== a.type.toLowerCase())) {
- a: if (a == document)
- b = !0;
- else {
- if (a.o && (b = a.o(),
- 0 > b.left || 0 > b.top)) {
- b = !1;
- break a
- }
- b = xb(a)
- }
- b = !b
- }
- if (b)
- return !1;
- b = [{
- timeout: 10,
- event: t(a, 'keydown', 13, 0)
- }, {
- timeout: 60,
- event: t(a, 'keypress', 13, 13)
- }, {
- timeout: 120,
- event: t(a, 'keyup', 13, 0)
- }];
- u || b.push({
- timeout: 300,
- event: qb()
- });
- for (var c = 0; c < b.length; ++c) {
- var d = b[c];
- vb(a, d.event, d.timeout)
- }
- return !0
- }
- function yb() {
- var a;
- return 'www.iwork.com' == document.location.host && (a = document.getElementById('complex_login_button')) ? ($(a, 'click'),
- !0) : 'www.icloud.com' == document.location.host && (a = document.getElementsByClassName('auth-submit'),
- 0 < a.length) ? ($(a[0], 'mousedown'),
- $(a[0], 'mouseup'),
- !0) : !1
- }
- function Sa(a, b, c) {
- var d = new pb, e;
- if (a) {
- var g = Ha();
- if (u)
- 'password' === a.type.toLowerCase() && wb();
- else if (b && null !== g && 'input' === g.tagName.toLowerCase() && 'password' === g.type.toLowerCase())
- setTimeout(Ea, 10, 'pressEnterKey');
- else if (e = a.form,
- a = window.MutationObserver || window.WebKitMutationObserver,
- !yb() && (!e || zb(e)))
- if (wb()) {
- var f = setTimeout(function() {
- c && sb(this, e)
- }
- .bind(d), 1E3);
- b = function() {
- clearTimeout(f)
- }
- ;
- a && (d.l = new a(b),
- d.l.observe(document, {
- childList: !0,
- subtree: !0
- }));
- window.addEventListener('beforeunload', b);
- window.addEventListener('pagehide', b);
- window.addEventListener('unload', b)
- } else
- c && sb(d, e)
- }
- }
- function tb(a, b) {
- if (!b)
- return [];
- for (var c = [], d = b.children, e = 0, g = d.length; e < g; e++) {
- var f = d[e];
- 'a' === Z(f) ? c.push(f) : f.children && 0 < f.children.length && (c = c.concat(tb(a, f)))
- }
- return c
- }
- function ub(a) {
- if (!a || 'a' !== Z(a))
- return !1;
- var b = J(a).toLowerCase()
- , c = (a.href || '').toLowerCase()
- , d = (a.getAttribute('id') || '').toLowerCase();
- return I(a.title, F) || I(a.id, F) || I(b, F) || I(a.title, E) || I(a.id, E) || I(b, E) || 0 !== c.indexOf('javascript:') && !a.onclick ? !1 : 0 <= c.indexOf('login') || 0 <= c.indexOf('signin') || 0 <= d.indexOf('login') || 0 <= d.indexOf('signin') || I(a.title, B) || Ab(b) ? !0 : !1
- }
- function $(a, b) {
- var c = document.createEvent('MouseEvent');
- 'object' === typeof self && 'object' === typeof self.port ? c.initMouseEvent(b, !0, !0, window, 1, 0, 0, 0, 0, !1, !1, !1, !1, 0, null) : c.initMouseEvent(b, !0, !0);
- a.dispatchEvent(c)
- }
- function zb(a) {
- if (!a)
- return !1;
- var b = a.getAttribute('method');
- return !b || 'post' !== b.toLowerCase() || qa(a) ? !1 : !0
- }
- function Ab(a) {
- if (!a || '' == a)
- return !1;
- a = a.replace(/^\s+/m, '').replace(/\s+$/m, '').replace(/\s\s+/, ' ').toLowerCase().trim();
- for (var b = 0, c = B.length; b < c; b++)
- if (a == B[b])
- return !0;
- return !1
- }
- function Z(a) {
- return a ? (a.tagName || '').toLowerCase() : ''
- }
- function xb(a) {
- if (a == document)
- return !0;
- if (!a || !a.parentNode)
- return !1;
- if (window.getComputedStyle) {
- if (!(a instanceof Element))
- return !1;
- var b = window.getComputedStyle(a, null);
- if ('none' == b.display || 'hidden' == b.visibility || 5 > b.width || 5 > b.height)
- return !1
- } else if (a.style && ('none' == a.style.display || 'hidden' == a.style.visibility))
- return !1;
- return xb(a.parentNode)
- }
- ;var Bb = {
- 'true': !0,
- y: !0,
- 1: !0,
- yes: !0,
- '✓': !0
- }
- , Cb = 200;
- function lb(a, b) {
- var c;
- if (!(!a || null === b || void 0 === b || ab && (a.disabled || a.f || a.readOnly)))
- switch ($a && a.form && !a.form.opfilled && (a.form.opfilled = !0),
- a.type ? a.type.toLowerCase() : null) {
- case 'checkbox':
- c = b && 1 <= b.length && Bb.hasOwnProperty(b.toLowerCase()) && !0 === Bb[b.toLowerCase()];
- a.checked === c || Db(a, function(a) {
- a.checked = c
- });
- break;
- case 'radio':
- !0 === Bb[b.toLowerCase()] && a.click();
- break;
- default:
- a.value == b || Db(a, function(a) {
- a.value = b
- })
- }
- }
- function Db(a, b) {
- aa(a);
- b(a);
- ba(a);
- oa(a) && (a.className += ' com-agilebits-onepassword-extension-animated-fill',
- setTimeout(function() {
- a && a.className && (a.className = a.className.replace(/(\s)?com-agilebits-onepassword-extension-animated-fill/, ''))
- }, Cb))
- }
- ;var Eb = 999
- , Fb = 254;
- document.com_agilebits_onepassword_collect = V;
- document.elementsByOPID = {};
- document.addEventListener('input', function(a) {
- !1 !== a.j && 'input' === a.target.tagName.toLowerCase() && (a.target.dataset['com.agilebits.onepassword.userEdited'] = 'yes')
- }, !0);
- function V(a, b) {
- function c(a, b) {
- var c = a[b];
- if ('string' == typeof c)
- return c;
- c = a.getAttribute(b);
- return 'string' == typeof c ? c : null
- }
- function d(a, b) {
- if (-1 === ['text', 'password'].indexOf(b.type.toLowerCase()) || !(x.test(a.value) || x.test(a.htmlID) || x.test(a.htmlName) || x.test(a.placeholder) || x.test(a['label-tag']) || x.test(a['label-data']) || x.test(a['label-aria'])))
- return !1;
- if (!a.visible)
- return !0;
- if ('password' == b.type.toLowerCase())
- return !1;
- var c = b.type;
- w(b, !0);
- return c !== b.type
- }
- function e(a) {
- switch (p(a.type)) {
- case 'checkbox':
- return a.checked ? '✓' : '';
- case 'hidden':
- a = a.value;
- if (!a || 'number' != typeof a.length)
- return '';
- a.length > Fb && (a = a.substr(0, Fb) + '...SNIPPED');
- return a;
- case 'submit':
- case 'button':
- case 'reset':
- if ('' === a.value)
- return K(J(a)) || '';
- default:
- return a.value
- }
- }
- function g(a) {
- return a.options ? (a = Array.prototype.slice.call(a.options).map(function(a) {
- var b = a.text
- , b = b ? p(b).replace(/\s/mg, '').replace(/[~`!@$%^&*()\-_+=:;'"\[\]|\\,<.>\/?]/mg, '') : null;
- return [b ? b : null, a.value]
- }),
- {
- options: a
- }) : null
- }
- function f(a) {
- var b;
- for (a = a.parentElement || a.parentNode; a && 'td' != p(a.tagName); )
- a = a.parentElement || a.parentNode;
- if (!a || void 0 === a)
- return null;
- b = a.parentElement || a.parentNode;
- if ('tr' != b.tagName.toLowerCase())
- return null;
- b = b.previousElementSibling;
- if (!b || 'tr' != (b.tagName + '').toLowerCase() || b.cells && a.cellIndex >= b.cells.length)
- return null;
- a = J(b.cells[a.cellIndex]);
- return a = K(a)
- }
- function l(b) {
- var c, d = [];
- if (b.labels && b.labels.length && 0 < b.labels.length)
- d = Array.prototype.slice.call(b.labels);
- else {
- b.id && (d = d.concat(Array.prototype.slice.call(m(a, 'label[for=' + JSON.stringify(b.id) + ']'))));
- if (b.name) {
- c = m(a, 'label[for=' + JSON.stringify(b.name) + ']');
- for (var e = 0; e < c.length; e++)
- -1 === d.indexOf(c[e]) && d.push(c[e])
- }
- for (c = b; c && c != a; c = c.parentNode)
- 'label' === p(c.tagName) && -1 === d.indexOf(c) && d.push(c)
- }
- 0 === d.length && (c = b.parentNode,
- 'dd' === c.tagName.toLowerCase() && null !== c.previousElementSibling && 'dt' === c.previousElementSibling.tagName.toLowerCase() && d.push(c.previousElementSibling));
- return 0 < d.length ? d.map(function(a) {
- return K(J(a))
- }).join('') : null
- }
- function k(a, b, c, d) {
- void 0 !== d && d === c || null === c || void 0 === c || (a[b] = c)
- }
- function p(a) {
- return 'string' === typeof a ? a.toLowerCase() : ('' + a).toLowerCase()
- }
- function m(a, b) {
- var c = [];
- try {
- c = a.querySelectorAll(b)
- } catch (d) {}
- return c
- }
- var A = a.defaultView ? a.defaultView : window
- , G = a.activeElement
- , x = RegExp('((\\b|_|-)pin(\\b|_|-)|password|passwort|kennwort|(\\b|_|-)passe(\\b|_|-)|contraseña|senha|密码|adgangskode|hasło|wachtwoord)', 'i')
- , s = Array.prototype.slice.call(m(a, 'form')).map(function(a, b) {
- var d = {}
- , e = '__form__' + b;
- a.opid = e;
- d.opid = e;
- k(d, 'htmlName', c(a, 'name'));
- k(d, 'htmlID', c(a, 'id'));
- k(d, 'htmlAction', ta(c(a, 'action')));
- k(d, 'htmlMethod', c(a, 'method'));
- return d
- })
- , H = sa(a).map(function(b, n) {
- b.hasAttribute('value') && !b.dataset['com.agilebits.onepassword.initialValue'] && (b.dataset['com.agilebits.onepassword.initialValue'] = b.value);
- var h = {}
- , m = '__' + n
- , r = -1 == b.maxLength ? Eb : b.maxLength;
- if (!r || 'number' === typeof r && isNaN(r))
- r = Eb;
- a.elementsByOPID[m] = b;
- b.opid = m;
- h.opid = m;
- h.elementNumber = n;
- k(h, 'maxLength', Math.min(r, 999), 999);
- h.visible = M(b);
- h.viewable = na(b);
- k(h, 'htmlID', c(b, 'id'));
- k(h, 'htmlName', c(b, 'name'));
- k(h, 'htmlClass', c(b, 'class'));
- k(h, 'tabindex', c(b, 'tabindex'));
- k(h, 'title', c(b, 'title'));
- k(h, 'userEdited', !!b.dataset['com.agilebits.onepassword.userEdited']);
- if ('hidden' != p(b.type)) {
- k(h, 'label-tag', l(b));
- k(h, 'label-data', c(b, 'data-label'));
- k(h, 'label-aria', c(b, 'aria-label'));
- k(h, 'label-top', f(b));
- m = [];
- for (r = b; r && r.nextSibling; ) {
- r = r.nextSibling;
- if (L(r))
- break;
- ja(m, r)
- }
- k(h, 'label-right', m.join(''));
- m = [];
- ma(b, m);
- m = m.reverse().join('');
- k(h, 'label-left', m);
- k(h, 'placeholder', c(b, 'placeholder'))
- }
- k(h, 'rel', c(b, 'rel'));
- k(h, 'type', p(c(b, 'type')));
- k(h, 'value', e(b));
- k(h, 'checked', b.checked, !1);
- k(h, 'autoCompleteType', b.getAttribute('x-autocompletetype') || b.getAttribute('autocompletetype') || b.getAttribute('autocomplete'), 'off');
- k(h, 'disabled', b.disabled);
- k(h, 'readonly', b.f || b.readOnly);
- k(h, 'selectInfo', g(b));
- k(h, 'aria-hidden', 'true' == b.getAttribute('aria-hidden'), !1);
- k(h, 'aria-disabled', 'true' == b.getAttribute('aria-disabled'), !1);
- k(h, 'aria-haspopup', 'true' == b.getAttribute('aria-haspopup'), !1);
- k(h, 'data-unmasked', b.dataset.unmasked);
- k(h, 'data-stripe', c(b, 'data-stripe'));
- k(h, 'data-braintree-name', c(b, 'data-braintree-name'));
- k(h, 'onepasswordFieldType', b.dataset.onepasswordFieldType || b.type);
- k(h, 'onepasswordDesignation', b.dataset.onepasswordDesignation);
- k(h, 'onepasswordSignInUrl', b.dataset.onepasswordSignInUrl);
- k(h, 'onepasswordSectionTitle', b.dataset.onepasswordSectionTitle);
- k(h, 'onepasswordSectionFieldKind', b.dataset.onepasswordSectionFieldKind);
- k(h, 'onepasswordSectionFieldTitle', b.dataset.onepasswordSectionFieldTitle);
- k(h, 'onepasswordSectionFieldValue', b.dataset.onepasswordSectionFieldValue);
- b.form && (h.form = c(b.form, 'opid'));
- k(h, 'fakeTested', d(h, b), !1);
- return h
- });
- H.filter(function(a) {
- return a.fakeTested
- }).forEach(function(b) {
- var c = a.elementsByOPID[b.opid];
- c.getBoundingClientRect();
- aa(c);
- c.click && c.click();
- b.postFakeTestVisible = M(c);
- b.postFakeTestViewable = na(c);
- b.postFakeTestType = c.type;
- ba(c)
- });
- A = {
- documentUUID: b,
- title: a.title,
- url: A.location.href,
- documentUrl: a.location.href,
- tabUrl: A.location.href,
- forms: function(a) {
- var b = {};
- a.forEach(function(a) {
- b[a.opid] = a
- });
- return b
- }(s),
- fields: H,
- collectedTimestamp: (new Date).getTime()
- };
- (s = document.querySelector('[data-onepassword-title]')) && s.dataset[DISPLAY_TITLE_ATTRIBUE] && (A.displayTitle = s.dataset.onepasswordTitle);
- G && 'input' === G.tagName.toLowerCase() && -1 === G.type.search(/button|submit|reset/i) && w(G, !0);
- return A
- }
- ;function Oa() {
- function a(a) {
- setTimeout(function() {
- var b = a.target;
- b.parentNode.removeChild(b.d);
- b.d = null
- }, 1E3)
- }
- function b(a) {
- a = a.target;
- var b = a.getBoundingClientRect()
- , f = e.createElement('DIV')
- , g = e.createElement('A')
- , A = d(a.opid)
- , G = e.createElement('H1')
- , x = e.createElement('CODE')
- , s = e.createElement('PRE');
- e.createElement('BR');
- a.d = f;
- a.parentNode.appendChild(a.d);
- G.innerText = A.opid;
- x.appendChild(s);
- s.innerText = JSON.stringify(A, null, '\t');
- f.appendChild(G);
- f.appendChild(x);
- f.setAttribute('class', 'onepasswordBubble');
- f.style.top = b.top + b.clientHeight / 2;
- f.style.left = b.left + b.clientWidth + 5;
- f.appendChild(g);
- g.innerText = 'Highlight Same Parents';
- g.addEventListener('click', c.bind(window, A.opid))
- }
- function c(a) {
- var b = d(a);
- f.fields.filter(function(a) {
- return a.parentId == b.parentId
- }).forEach(function(a) {
- e.elementsByOPID[a.opid].style.outline = '1px solid red'
- })
- }
- function d(a) {
- var b;
- f.fields.forEach(function(c) {
- c.opid == a && (b = c)
- });
- return b
- }
- var e = document
- , g = sa(e)
- , f = V(e, R);
- g.forEach(function(c) {
- c.addEventListener('focus', b);
- c.addEventListener('blur', a)
- })
- }
- ;
Advertisement
Add Comment
Please, Sign In to add comment