Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function audioKeeper() {
- BestDealsNotif = new Audio;
- BestDealsNotif['preload'] = 'auto';
- BestDealsNotif['src'] = 'sounds/BestDealsNotif.mp3';
- penWrite = new Audio;
- penWrite['preload'] = 'auto';
- penWrite['src'] = 'sounds/penWrite.ogg';
- penOff = new Audio;
- penOff['preload'] = 'auto';
- penOff['src'] = 'sounds/penOff.mp3';
- setTimeout(audioKeeper, 120000);
- }
- function outGoingTradeoffers() {
- try {
- if ('connectionTrue' == localStorage['getItem']('OnConnection')) {
- if (void(0) != outgoingOffers['match'](/^[0-9]*\;/g)) {
- var _outgoing_offer_id_ = outgoingOffers['match'](/^[0-9]*\;/g);
- _outgoing_offer_id_ = _outgoing_offer_id_.toString()['replace'](';', '');
- /* здесь переменная _tradeoffer_ используется для хранения URL */
- var _tradeoffer_ = 'https://steamcommunity.com/tradeoffer/' + _outgoing_offer_id_ + '/',
- _local_request_ = new XMLHttpRequest;
- _local_request_['open']('GET', _tradeoffer_, !0);
- _local_request_['send'](null);
- _local_request_['onreadystatechange'] = function() {
- if (4 == _local_request_['readyState']) {
- if (_local_request_['responseText']) {
- var _tradeoffer_ = _local_request_['responseText'],
- _tradeoffer_html_ = '<div>' + _tradeoffer_ + '</div>';
- /* здесь переменная _tradeoffer_ используется для хранения элемента с ответом сервера */
- _tradeoffer_ = $(_tradeoffer_html_);
- if (void(0) != $('_trade_area_', _tradeoffer_)['html']()) {
- var _session_id_ = '',
- _index_of_session_id_ = _tradeoffer_html_['indexOf']('g_sessionID = "');
- for (_index_of_session_id_ += 15; '"' != _tradeoffer_html_[_index_of_session_id_]; ) {
- _session_id_ += _tradeoffer_html_[_index_of_session_id_];
- _index_of_session_id_++;
- };
- var _index_of_partner_steam_id_ = _tradeoffer_html_['indexOf']('g_ulTradePartnerSteamID = \'');
- _index_of_partner_steam_id_ += 27;
- for (var _partner_steam_id_ = ''; '\'' != _tradeoffer_html_[_index_of_partner_steam_id_]; ) {
- _partner_steam_id_ += _tradeoffer_html_[_index_of_partner_steam_id_];
- _index_of_partner_steam_id_++;
- };
- outGoingData = 'sessionid=' + _session_id_ + '&serverid=1&tradeofferid=' + _outgoing_offer_id_ + '&partner=' + _partner_steam_id_ + '&captcha=';
- chrome['tabs']['create']({
- url: 'https://steamcommunity.com/tradeoffer/' + _outgoing_offer_id_ + '/#tradeconfirm',
- selected: !1
- }, function(_outgoing_offer_id_) {
- outgoingOrderTabId = _outgoing_offer_id_['id']
- })
- } else {
- if (outGoingSpecTry >= 2) {
- outgoingOffers = outgoingOffers['replace'](_outgoing_offer_id_ + ';', '');
- outGoingSpecTry = 0
- }
- outGoingSpecTry++;
- setTimeout(outGoingTradeoffers, 5000);
- }
- } else {
- setTimeout(outGoingTradeoffers, 5000)
- }
- }
- }
- } else {
- setTimeout(outGoingTradeoffers, 5000)
- }
- } else {
- outgoingOffers = '';
- setTimeout(outGoingTradeoffers, 5000)
- }
- } catch (_outgoing_offer_id_) {
- setTimeout(outGoingTradeoffers, 5000)
- }
- }
- function incomingTradeoffers() {
- try {
- if (void(0) != incomingOffers['match'](/^[0-9]*\;/g)) {
- var _incoming_offer_id_ = incomingOffers['match'](/^[0-9]*\;/g);
- _incoming_offer_id_ = _incoming_offer_id_.toString()['replace'](';', '');
- var _tradeoffer_ = 'https://steamcommunity.com/tradeoffer/' + _incoming_offer_id_ + '/',
- _local_request_ = new XMLHttpRequest;
- _local_request_['open']('GET', _tradeoffer_, !0), _local_request_['send'](null), _local_request_['onreadystatechange'] = function() {
- if (4 == _local_request_['readyState']) {
- if (_local_request_['responseText']) {
- var _tradeoffer_ = _local_request_['responseText'],
- _tradeoffer_html_ = '<div>' + _tradeoffer_ + '</div>';
- if (_tradeoffer_ = $(_tradeoffer_html_), void(0) != $('.trade_area', _tradeoffer_)['html']()) {
- var _session_id_ = '',
- _index_of_session_id_ = _tradeoffer_html_['indexOf']('g_sessionID = "');
- for (_index_of_session_id_ += 15;
- '"' != _tradeoffer_html_[_index_of_session_id_];) {
- _session_id_ += _tradeoffer_html_[_index_of_session_id_], _index_of_session_id_++
- };
- var _index_of_partner_steam_id_ = _tradeoffer_html_['indexOf']('g_ulTradePartnerSteamID = \'');
- _index_of_partner_steam_id_ += 27;
- for (var _partner_steam_id_ = '';
- '\'' != _tradeoffer_html_[_index_of_partner_steam_id_];) {
- _partner_steam_id_ += _tradeoffer_html_[_index_of_partner_steam_id_], _index_of_partner_steam_id_++
- };
- incomingData = 'sessionid=' + _session_id_ + '&serverid=1&tradeofferid=' + _incoming_offer_id_ + '&partner=' + _partner_steam_id_ + '&captcha=', chrome['tabs']['create']({
- url: 'https://steamcommunity.com/tradeoffer/' + _incoming_offer_id_ + '/#incomingTradeOfferConf',
- selected: !1
- }, function(_incoming_offer_id_) {
- incomingOrderTabId = _incoming_offer_id_['id']
- })
- } else {
- if (incomingSpecTry >= 2) {
- incomingOffers = incomingOffers['replace'](_incoming_offer_id_ + ';', '');
- incomingSpecTry = 0;
- }
- incomingSpecTry++;
- setTimeout(incomingTradeoffers, 5000);
- }
- } else {
- setTimeout(incomingTradeoffers, 5000)
- }
- }
- }
- } else {
- setTimeout(incomingTradeoffers, 5000)
- }
- } catch (_incoming_offer_id_) {
- setTimeout(incomingTradeoffers, 5000)
- }
- }
- function subInterval() {
- var _local_request_ = new XMLHttpRequest;
- _local_request_['open']('GET', 'http://extensions.risenraise.com/profile/', !0);
- _local_request_['send'](null);
- _local_request_['onreadystatechange'] = function() {
- if (4 == _local_request_['readyState']) {
- if (_local_request_['responseText'] && 200 == _local_request_['status']) {
- var _response_text_ = _local_request_['responseText'],
- _email_ = $('#email', _response_text_)['text']();
- if ('' != _email_) {
- /* значение переменной _value_ неочевидно */
- var _value_ = $('span[name="Opskins Trade Helper"]', _response_text_)['text']();
- if (void(0) != _value_ && '' != _value_ && parseInt(_value_) >= 0) {
- if ('0' == _value_) {
- _value_ = 1;
- }
- } else {
- _value_ = '0';
- };
- localStorage['setItem']('accountMail', 'activated');
- localStorage['setItem']('days', '\u221E');
- localStorage['setItem']('sub', 'true');
- chrome['storage']['sync']['set']({
- opsSub: 'true'
- })
- } else {
- var _value_ = '0';
- localStorage['setItem']('accountMail', 'activated');
- localStorage['setItem']('sub', 'true');
- localStorage['setItem']('days', '\u221E');
- chrome['storage']['sync']['set']({
- opsSub: 'true'
- })
- };
- setTimeout(subInterval, 1800000)
- } else {
- setTimeout(subInterval, 30000)
- }
- }
- }
- }
- var quickConfirm = !1,
- quickRemoveTabId = '',
- subcheck = !1,
- outgoingOffers = '',
- outGoingData = '',
- outgoingOrderTabId = '',
- incomingOffers = '',
- incomingData = '',
- incomingOrderTabId = '',
- BestDealsNotif,
- penWrite,
- penOff;
- audioKeeper();
- localStorage['removeItem']('accountMail');
- localStorage['removeItem']('days');
- localStorage['removeItem']('sub');
- chrome['storage']['sync']['set']({
- opsSub: 'false'
- });
- setTimeout(outGoingTradeoffers, 100);
- setTimeout(incomingTradeoffers, 100);
- chrome['notifications']['onClicked']['addListener'](function(_notificationId_) {
- if ('tradeFail' == _notificationId_) {
- chrome['tabs']['create']({
- url: 'https://steamcommunity.com/'
- });
- }
- chrome['notifications']['clear'](_notificationId_, function() {});
- });
- chrome['tabs']['onRemoved']['addListener'](function(_tabId_, _removeInfo_) {
- if (_tabId_ == quickRemoveTabId) {
- quickConfirm = !1;
- }
- if (_tabId_ == outgoingOrderTabId) {
- outGoingData = '';
- outGoingTradeoffers();
- }
- if (_tabId_ == incomingOrderTabId) {
- incomingData = '';
- incomingTradeoffers()
- }
- });
- chrome['runtime']['onMessage']['addListener'](function(_message_, _sender_, _sendResponse_) {
- if (/freshSpecialData\:/g ['test'](_message_)) {
- var _processed_message_ = _message_['replace'](/freshSpecialData\:/gim, ''),
- _user_id_ = _processed_message_;
- localStorage['setItem']('userId', _user_id_);
- chrome['cookies']['get']({
- url: 'https://opskins.com/',
- name: 'PHPSESSID'
- }, function(_cookie_) {
- if (_cookie_['name'] != localStorage['getItem']('PHPSESSID')) {
- localStorage['setItem']('PHPSESSID', _cookie_['value']);
- }
- });
- chrome['cookies']['get']({
- url: 'https://opskins.com/',
- name: 'opskins_csrf_token'
- }, function(_cookie_) {
- if (_cookie_['name'] != localStorage['getItem']('csrf')) {
- localStorage['setItem']('csrf', _cookie_['value']);
- }
- })
- } else {
- if ('deleteSpecialData' == _message_) {
- localStorage['removeItem']('csrf');
- localStorage['removeItem']('userId');
- localStorage['removeItem']('PHPSESSID');
- } else {
- if ('fastFASTfast' == _message_) {
- chrome['tabs']['create']({
- url: 'https://opskins.com/?loc=shop_checkout'
- })
- } else {
- if (/quickLog\:/gim ['test'](_message_)) {
- var _options_ = {
- type: 'basic',
- title: 'Quick Buy',
- message: _message_['replace']('quickLog:', ''),
- iconUrl: 'images/icon128.png'
- };
- chrome['notifications']['clear']('quickLog', function() {});
- chrome['notifications']['create']('quickLog', _options_, function(_notificationId_) {})
- } else {
- if (/quickMsgBL\:/gim ['test'](_message_)) {
- var _options_ = {
- type: 'basic',
- title: 'Black List',
- message: _message_['replace']('quickMsgBL:', ''),
- iconUrl: 'images/icon128.png'
- };
- chrome['notifications']['clear']('quickMsgBL', function() {});
- chrome['notifications']['create']('quickMsgBL', _options_, function(_notificationId_) {})
- } else {
- if (/tradeSuccess\:/gim ['test'](_message_)) {
- var _options_ = {
- type: 'basic',
- title: 'Quick Buy',
- message: _message_['replace'](/tradeSuccess\:/gim, ''),
- iconUrl: 'images/icon128.png'
- };
- chrome['notifications']['clear']('quickLog', function() {});
- chrome['notifications']['clear']('tradeSuccess', function() {});
- chrome['notifications']['create']('tradeSuccess', _options_, function(_notificationId_) {})
- } else {
- if (/tradeFail\:/gim ['test'](_message_)) {
- var _options_ = {
- type: 'basic',
- title: 'Quick Buy',
- message: _message_['replace'](/tradeFail\:/gim, ''),
- iconUrl: 'images/icon128.png'
- };
- chrome['notifications']['clear']('quickLog', function() {});
- chrome['notifications']['clear']('tradeFail', function() {});
- chrome['notifications']['create']('tradeFail', _options_, function(_notificationId_) {})
- } else {
- if ('getQuickConfirm' == _message_) {
- chrome['tabs']['sendMessage'](_sender_['tab']['id'], quickConfirm);
- } else {
- if ('getSpecialData' == _message_) {
- var _local_request__ = new XMLHttpRequest;
- _local_request__['open']('GET', 'https://opskins.com/?loc=support_tickets', !0);
- _local_request__['send'](null);
- _local_request__['onreadystatechange'] = function() {
- if (4 == _local_request__['readyState']) {
- if (_local_request__['responseText']) {
- var _element_out_of_response_text_ = $('<div>' + _local_request__['responseText'] + '</div>');
- if (void(0) != $('.avatar-menu', _element_out_of_response_text_)['html']()) {
- var _scripts_quantity_ = $('script:not(:empty)', _element_out_of_response_text_)['size'](),
- _code_to_eval_ = '';
- for (_index_ = 0; _index_ < _scripts_quantity_; ) {
- _code_to_eval_ = $('script:not(:empty):eq(' + _index_ + ')', _element_out_of_response_text_)['text']();
- if (_code_to_eval_['indexOf']('g_UID') > -1) {
- eval(_code_to_eval_);
- _index_ = _scripts_quantity_;
- }
- _index_++;
- };
- try {
- var _user_id_ = g_UID;
- localStorage['setItem']('userId', _user_id_);
- var _options_ = {
- type: 'basic',
- title: 'Opskins Trade Helper',
- message: 'Special data collected.',
- iconUrl: 'images/icon128.png'
- };
- chrome['notifications']['clear']('specialDataNotif', function() {});
- chrome['notifications']['create']('specialDataNotif', _options_, function(_notificationId_) {});
- chrome['cookies']['get']({
- url: 'https://opskins.com/',
- name: 'opskins_csrf_token'
- }, function(_cookie_) {
- localStorage['setItem']('csrf', _cookie_['value']);
- chrome['cookies']['get']({
- url: 'https://opskins.com/',
- name: 'PHPSESSID'
- }, function(_cookie_) {
- localStorage['setItem']('PHPSESSID', _cookie_['value']);
- chrome['runtime']['sendMessage']('readyData');
- })
- })
- } catch (a) {
- var _options_ = {
- type: 'basic',
- title: 'Opskins Trade Helper',
- message: 'Special data error.',
- iconUrl: 'images/icon128.png'
- };
- chrome['notifications']['clear']('specialDataNotif', function() {});
- chrome['notifications']['create']('specialDataNotif', _options_, function(_notificationId_) {});
- console['log'](a), chrome['runtime']['sendMessage']('readyData');
- }
- } else {
- localStorage['removeItem']('csrf');
- localStorage['removeItem']('userId');
- localStorage['removeItem']('PHPSESSID');
- var _options_ = {
- type: 'basic',
- title: 'Opskins Trade Helper',
- message: 'Sign In to OPSkins.',
- iconUrl: 'images/icon128.png'
- };
- chrome['notifications']['clear']('specialDataNotif', function() {});
- chrome['notifications']['create']('specialDataNotif', _options_, function(_notificationId_) {});
- chrome['runtime']['sendMessage']('readyData');
- }
- } else {
- var _options_ = {
- type: 'basic',
- title: 'Opskins Trade Helper',
- message: 'Failed to collect special data.\x0AINTERNET DSCONECTED',
- iconUrl: 'images/icon128.png'
- };
- chrome['notifications']['clear']('specialDataNotif', function() {});
- chrome['notifications']['create']('specialDataNotif', _options_, function(_notificationId_) {});
- chrome['runtime']['sendMessage']('readyData')
- }
- }
- }
- } else {
- if (/InventoryManager\:/gim ['test'](_message_)) {
- var _options_ = {
- type: 'basic',
- title: 'Inventory Manager',
- message: _message_['replace'](/InventoryManager\:/gim, ''),
- iconUrl: 'images/icon128.png'
- };
- chrome['notifications']['clear']('InventoryManager', function() {});
- chrome['notifications']['create']('InventoryManager', _options_, function(_notificationId_) {})
- } else {
- if ('startsubcheck' == _message_) {
- if (1 != subcheck) {
- setTimeout(subInterval, 1800000)
- }
- subcheck = !0;
- } else {
- if (/^BDS_BL_Inport\:/gim ['test'](_message_)) {
- var _stored_BestDealsSeacher_BL_ = localStorage['getItem']('BestDealsSeacher_BL'),
- _prepared_BestDealsSeacher_BL_ = '[' + _message_['replace'](/^BDS_BL_Inport\:/gim, '') + '];';
- if (void(0) == _stored_BestDealsSeacher_BL_) {
- localStorage['setItem']('BestDealsSeacher_BL', _prepared_BestDealsSeacher_BL_);
- chrome['runtime']['sendMessage']('upd_BDS_BL:' + _prepared_BestDealsSeacher_BL_);
- var _options_ = {
- type: 'basic',
- title: 'Best Deals Searcher',
- message: _prepared_BestDealsSeacher_BL_['replace'](/\]\;$/, '')['replace'](/^\[/, '') + '\x0Aadded to the BlackList',
- iconUrl: 'images/blimg.png'
- };
- penWrite['play']();
- chrome['notifications']['clear']('bds_bl_msg', function() {});
- chrome['notifications']['create']('bds_bl_msg', _options_, function(_notificationId_) {})
- } else {
- if (_stored_BestDealsSeacher_BL_['indexOf'](_prepared_BestDealsSeacher_BL_) > -1) {
- var _options_ = {
- type: 'basic',
- title: 'Best Deals Searcher',
- message: 'This item is already in the list',
- iconUrl: 'images/icon128.png'
- };
- penOff['play']();
- chrome['notifications']['clear']('bds_bl_msg', function() {});
- chrome['notifications']['create']('bds_bl_msg', _options_, function(_notificationId_) {})
- } else {
- _stored_BestDealsSeacher_BL_ = _prepared_BestDealsSeacher_BL_ + _stored_BestDealsSeacher_BL_;
- localStorage['setItem']('BestDealsSeacher_BL', _stored_BestDealsSeacher_BL_);
- chrome['runtime']['sendMessage']('upd_BDS_BL:' + _prepared_BestDealsSeacher_BL_);
- var _options_ = {
- type: 'basic',
- title: 'Best Deals Searcher',
- message: _prepared_BestDealsSeacher_BL_['replace'](/\]\;$/, '')['replace'](/^\[/, '') + '\x0Aadded to the BlackList',
- iconUrl: 'images/blimg.png'
- };
- penWrite['play']();
- chrome['notifications']['clear']('bds_bl_msg', function() {});
- chrome['notifications']['create']('bds_bl_msg', _options_, function(_notificationId_) {})
- }
- }
- } else {
- if ('This item is already in the list' == _message_) {
- var _options_ = {
- type: 'basic',
- title: 'Best Deals Searcher',
- message: 'This item is already in the list',
- iconUrl: 'images/icon128.png'
- };
- chrome['notifications']['clear']('bds_bl_msg', function() {});
- chrome['notifications']['create']('bds_bl_msg', _options_, function(_notificationId_) {})
- } else {
- if (/confirmThisOutgoingTrade\:/gim ['test'](_message_)) {
- var _confirmThisOutgoingTrade_ = _message_['replace'](/confirmThisOutgoingTrade\:/gim, '');
- outgoingOffers = outgoingOffers + _confirmThisOutgoingTrade_ + ';'
- } else {
- if ('getOutgoingData' == _message_) {
- chrome['tabs']['sendMessage'](_sender_['tab']['id'], 'outGoingData:' + outGoingData + ';;;' + outgoingOffers['match'](/^[0-9]*\;/g).toString()['replace'](';', ''));
- } else {
- if ('outGoingTradeConfirmed' == _message_) {
- chrome['runtime']['sendMessage']('successOutgoingTradeOffer:' + outgoingOffers['match'](/^[0-9]*\;/g).toString()['replace'](';', ''));
- outgoingOffers = outgoingOffers['replace'](/^[0-9]*\;/g, '');
- outGoingSpecTry = 0;
- } else {
- if (/quickConfirmTadeoffer\:/gim ['test'](_message_)) {
- var _quickConfirmTadeoffer_ = _message_['replace'](/quickConfirmTadeoffer\:/gim, '');
- incomingOffers = incomingOffers + _quickConfirmTadeoffer_ + ';'
- } else {
- if ('getIncomingData' == _message_) {
- chrome['tabs']['sendMessage'](_sender_['tab']['id'], 'incomingData:' + incomingData + ';;;' + incomingOffers['match'](/^[0-9]*\;/g).toString()['replace'](';', ''));
- } else {
- if ('incomingTradeConfirmed' == _message_) {
- chrome['runtime']['sendMessage']('successIncomingTradeOffer:' + incomingOffers['match'](/^[0-9]*\;/g).toString()['replace'](';', ''));
- incomingOffers = incomingOffers['replace'](/^[0-9]*\;/g, '');
- incomingSpecTry = 0
- } else {
- if (/DealsNotif\:/gim ['test'](_message_)) {
- var _options_ = {
- type: 'basic',
- title: 'Best Deals Searcher',
- message: _message_['replace'](/DealsNotif\:/gim, ''),
- iconUrl: 'images/icon128.png'
- };
- BestDealsNotif['play']();
- chrome['notifications']['clear']('DealsNotif', function() {});
- chrome['notifications']['create']('DealsNotif', _options_, function(_notificationId_) {})
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- });
- localStorage['setItem']('OnConnection', 'connectionFalse');
- chrome['runtime']['onMessageExternal']['addListener'](function(_message_, _sender_, _sendResponse_) {
- _message_ = _message_['data'];
- if ('connectionTrue' == _message_) {
- localStorage['setItem']('OnConnection', _message_);
- chrome['runtime']['sendMessage']('checkConnetion');
- }
- if ('connectionFalse' == _message_) {
- localStorage['setItem']('OnConnection', _message_);
- chrome['runtime']['sendMessage']('checkConnetion');
- }
- });
- var outGoingSpecTry = 0, incomingSpecTry = 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement