Created
          July 19, 2012 09:32 
        
      - 
      
- 
        Save JaHIY/3142676 to your computer and use it in GitHub Desktop. 
    Greasemonky script:Bilibili test-version flash player
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // ==UserScript== | |
| // @name Bilibili test-version flash player | |
| // @description this script can force browser use test-version flash player | |
| // @author jahiy | |
| // @version 0.3.1 | |
| // @match https://secure.bilibili.tv/secure,* | |
| // @match http://www.bilibili.tv/video/* | |
| // ==/UserScript== | |
| function main() { | |
| "use strict"; | |
| var a,b; | |
| if(document.querySelector) { | |
| a=document.querySelectorAll("embed[src$='/play.swf']"); | |
| } else { | |
| a=[].filter.call(document.embeds,function(c){return (/\/play.swf$/.test(c.getAttribute("src")) === true);}); | |
| } | |
| if(a.length !== 0) { | |
| [].map.call(a,function(c){c.attributes['src'].value=c.attributes['src'].value.replace(/play.swf$/,"play_test.swf");}); | |
| } | |
| } | |
| main(); | |
| /* @xnreformer 大大的一行代码解决问题 | |
| [].map.call(document.getElementsByTagName("embed"),function(t){t.src=t.src.replace(/play.swf$/,"play_test.swf")}); | |
| */ | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment