File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 11// ==UserScript==
22// @name 不学习何以强国-beta
33// @namespace http://tampermonkey.net/
4- // @version 20220205
4+ // @version 20220206
55// @description 问题反馈位置: https://github.com/TechXueXi/techxuexi-js/issues 。读文章,看视频,做习题。
66// @author techxuexi ,荷包蛋。
77// @match https://www.xuexi.cn
@@ -169,6 +169,8 @@ function getVideoTag() {
169169 let iframe = document . getElementsByTagName ( "iframe" ) [ 0 ] ;
170170 let video = null ;
171171 let pauseButton = null ;
172+ var u = navigator . userAgent ;
173+ if ( u . indexOf ( 'Mac' ) > - 1 ) { //Mac
172174 if ( iframe . innerHTML ) {
173175 //如果有iframe,说明外面的video标签是假的
174176 video = iframe . contentWindow . document . getElementsByTagName ( "video" ) [ 0 ] ;
@@ -182,6 +184,22 @@ function getVideoTag() {
182184 "video" : video ,
183185 "pauseButton" : pauseButton
184186 }
187+ }
188+ else {
189+ if ( iframe ) {
190+ //如果有iframe,说明外面的video标签是假的
191+ video = iframe . contentWindow . document . getElementsByTagName ( "video" ) [ 0 ] ;
192+ pauseButton = iframe . contentWindow . document . getElementsByClassName ( "prism-play-btn" ) [ 0 ] ;
193+ } else {
194+ //否则这个video标签是真的
195+ video = document . getElementsByTagName ( "video" ) [ 0 ] ;
196+ pauseButton = document . getElementsByClassName ( "prism-play-btn" ) [ 0 ] ;
197+ }
198+ return {
199+ "video" : video ,
200+ "pauseButton" : pauseButton
201+ }
202+ }
185203}
186204
187205//读新闻或者看视频
You can’t perform that action at this time.
0 commit comments