File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22// @name 百Bing图
33// @name :en BingBgForBaidu
44// @namespace hoothin
5- // @version 1.2
5+ // @version 1.3
66// @description 把百度首页背景图换成Bing的
77// @description :en Just change the background image of baidu.com to bing.com
88// @author hoothin
7878 if ( ! / ^ h t t p s ? : \/ \/ / . test ( bgUrl ) ) {
7979 bgUrl = "http://global.bing.com" + bgUrl ;
8080 }
81- bgUrl = "url(\"" + bgUrl + "\")" ;
8281 var skinContainer = document . querySelector ( ".s-skin-container" ) ;
8382 if ( ! skinContainer ) {
8483 return ;
8584 }
8685 var bingBgLink = document . createElement ( "a" ) ;
8786 bingBgLink . title = "Bing图" ;
88- bingBgLink . href = jsonData . images [ 0 ] . url ;
87+ bingBgLink . href = bgUrl ;
8988 bingBgLink . innerHTML = "<span class='title'>Bing图</span>" ;
9089 document . querySelector ( "#s_icons" ) . appendChild ( bingBgLink ) ;
90+ bgUrl = "url(\"" + bgUrl + "\")" ;
9191 if ( skinContainer . style . backgroundImage != bgUrl ) {
9292 skinContainer . style . backgroundImage = bgUrl ;
9393 }
You can’t perform that action at this time.
0 commit comments