Greasy Fork 还支持 简体中文。

YouTube Player for Forocoches

Never thought I would made something so unsettling, enjoy it!

目前為 2016-07-04 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name YouTube Player for Forocoches
  3. // @name:es Reproductor de YouTube para Forocoches
  4. // @description Never thought I would made something so unsettling, enjoy it!
  5. // @description:es Nunca pensé que terminaría haciendo algo tan demigrante, ¡de nada!
  6. // @namespace swyter
  7. // @match *://www.forocoches.com/*
  8. // @match *://m.forocoches.com/*
  9. // @match *://forocoches.com/*
  10. // @version 1.1.1.3
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. /* switch the iframe source to a less scummy one */
  15.  
  16. for (var cur in (vids=document.querySelectorAll("iframe[src*=smartycenter]")))
  17. {
  18. if(typeof vids[cur] !== 'object')
  19. continue;
  20.  
  21. vids[cur].src = 'https://www.youtube.com/embed/' + vids[cur].src.split("/")[6];
  22. }
  23.  
  24. /* remove random crap */
  25.  
  26. filters =
  27. [
  28. "#infocookie",
  29. "div[id^='div-']",
  30. "ul[style*='#ca3415'] + ul",
  31. "a + ul + br",
  32. ".cajasprin"
  33. ];
  34.  
  35. for (var cur in (junk=document.querySelectorAll(filters.join(', '))))
  36. {
  37. if(typeof junk[cur] !== 'object')
  38. continue;
  39.  
  40. console.log("Removed junk element: " + junk[cur]);
  41. junk[cur].parentElement.removeChild(junk[cur]);
  42. }
  43.  
  44. /* wait until the page is ready for the code snippet to run */
  45. document.addEventListener('DOMContentLoaded', function()
  46. {
  47. console.log("!!! DOMContentLoaded");
  48.  
  49. for(a of (document.querySelectorAll("div[id^=post_message]")))
  50. {
  51. if (a.childNodes[0].nodeValue.trim().match("Este mensaje está oculto porque .+ está en tu lista de ignorados(.)?$") != null)
  52. {
  53. console.log(a, a.childNodes[0].nodeValue);
  54.  
  55. a = a.parentElement.parentElement.parentElement.parentElement;
  56. a.parentElement.removeChild(a);
  57. }
  58. }
  59. blocked_users =
  60. [
  61. 'Pedrote', 'RAMON38', 'Orof', 'matalpinensis', 'Kurtcob', 'DalePapi', 'pinilleitor', 'Zenobio73',
  62. 'kevinxuan', 'Euritos', '-Averia-', 'Mcbubles', 'Medlinor', 'Amon Amarth','ShurKhalifa', 'Satou',
  63. 'sirp', 'spilock', 'amstel', 'josalb', 'pablitochu89', 'sagi1978', 'Mr. Deadpool', 'DeBoer',
  64. 'Jabyesp', 'mcarlosd', 'eosal', 'Mugremita', 'chafer', 'KRASNY BOR', 'Recaredo'
  65. ]
  66. for (e of document.querySelectorAll(".bigusername, .smallfont > span[onclick]"))
  67. {
  68. if (!(blocked_users.indexOf(e.textContent) != -1))
  69. continue;
  70.  
  71. console.log('Obscured posts by blocked user: ', e.textContent);
  72.  
  73. (e.nodeName != 'SPAN' ?
  74. e.parentNode.parentNode.parentNode.parentNode.parentElement :
  75. e.parentNode.parentNode.parentNode
  76. ).style.opacity = 0.3;
  77. }
  78. });