gmo61520

Untitled

Jun 29th, 2016
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. (function (){
  2. var s = document.getElementById('__cmext_style');
  3. if (s) s.parentNode.removeChild(s);
  4. s = document.createElement('style');
  5. s.id = '__cmext_style';
  6. document.head.appendChild(s);
  7. s.innerHTML = ''.slice.call(function(){/*
  8. #__cmext_start_btn {
  9. display: block !important;
  10. position: fixed !important;
  11. bottom: 20px !important;
  12. right: 20px !important;
  13. width: 72px !important;
  14. height: 72px !important;
  15. border-radius: 2px !important;
  16. background: #A20025 !important;
  17. color: white !important;
  18. text-transform: uppercase !important;
  19. text-decoration: none !important;
  20. font-size: 13px !important;
  21. font-weight: bold !important;
  22. line-height: 27px !important;
  23. padding: 8px !important;
  24. text-align: center !important;
  25. color: #FFF !important;
  26. }
  27.  
  28. #__cmext_start_btn:hover, #__cmext_start_btn:active {
  29. color: #FFF !important;
  30. background: #990024 !important;
  31. text-decoration: none !important;
  32. }
  33. */}, 14, -3);
  34.  
  35. var eventId = (location.href.match(/\beventId?=(\d+)\b/i)||{})[1];
  36. var carId = (location.href.match(/\bcar(?:Id)?=(\d+)\b/i)||{})[1];
  37. var trackId = (location.href.match(/\btrack(?:Id)?=(\d+)\b/i)||{})[1];
  38.  
  39. if (eventId != null || carId != null && trackId != null){
  40. var cmEventId = eventId || trackId + '/' + carId;
  41. var button = document.createElement('a');
  42. button.id = '__cmext_start_btn';
  43. button.innerHTML = '<img src="' + chrome.extension.getURL('icon-48.png') + '"><br>Start';
  44. button.href = 'acmanager://rsr?id=' + encodeURIComponent(cmEventId);
  45. document.body.appendChild(button);
  46. }
  47.  
  48. var ths = document.getElementsByTagName('th');
  49. for (var i=0; i<ths.length; i++) if (ths[i].innerHTML == 'Download') ths[i].innerHTML = 'Install';
  50. var hs = document.getElementsByTagName('a');
  51. for (var i=0, m; i<hs.length; i++) if (m = hs[i].href.match(/=download_setup&id=(\d+)/)) hs[i].href = 'acmanager://rsr/setup?id=' + m[1];
  52. })();
Advertisement
Add Comment
Please, Sign In to add comment