dnvod.tv hack

try to take over the world! *** let this script run in the document-start ***

  1. // ==UserScript==
  2. // @name dnvod.tv hack
  3. // @namespace https://greasyfork.org/zh-CN/scripts/29130-dnvod-tv-hack
  4. // @version 0.3
  5. // @description try to take over the world! *** let this script run in the document-start ***
  6. // @author march511@gmail.com
  7. // @match http://www.dnvod.tv/Movie/Readyplay.aspx?id=*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. var xhr = window.XMLHttpRequest;
  15. var open = xhr.prototype.open;
  16. xhr.prototype.open = function (method, url, async, user, password) {
  17.  
  18. console.log('Checking', url);
  19. if (url.startsWith('/Movie/GetResource.ashx')) {
  20.  
  21. this.addEventListener('load', function (e) {
  22.  
  23. var result = JSON.parse(this.responseText);
  24. var url = result.http.provider;
  25. console.log('opening', url);
  26. window.open(url);
  27.  
  28. });
  29.  
  30. }
  31.  
  32. return open.apply(this, arguments);
  33. };
  34.  
  35. }) ();