File tree Expand file tree Collapse file tree 1 file changed +0
-47
lines changed
Expand file tree Collapse file tree 1 file changed +0
-47
lines changed Original file line number Diff line number Diff line change 11/* eslint-disable complexity */
2- window . setInterval = function ( delay , fn ) {
3- var start = Date . now ( ) ;
4- var data = { } ;
5- data . id = requestAnimationFrame ( loop ) ;
6-
7- return data ;
8-
9- function loop ( ) {
10- data . id = requestAnimationFrame ( loop ) ;
11-
12- if ( Date . now ( ) - start >= delay ) {
13- fn ( ) ;
14- start = Date . now ( ) ;
15- }
16- }
17- } ;
18-
19- window . clearInterval = function ( data ) {
20- try {
21- cancelAnimationFrame ( data . id ) ;
22- } catch ( e ) {
23- console . warn ( "clearInterval failed:" , e ) ;
24- }
25- } ;
26-
27- window . setTimeout = function ( fn , delay , ...args ) {
28- var start = Date . now ( ) ;
29- var data = Object . create ( null ) ;
30- data . id = requestAnimationFrame ( loop ) ;
31-
32- return data ;
33-
34- function loop ( ) {
35- Date . now ( ) - start >= delay ? fn ( ...args ) : ( data . id = requestAnimationFrame ( loop ) ) ;
36- }
37- } ;
38-
39- window . clearTimeout = function ( data ) {
40- if ( data && typeof data === "object" && data . id !== undefined ) {
41- try {
42- cancelAnimationFrame ( data . id ) ;
43- } catch ( e ) {
44- console . warn ( "clearTimeout failed:" , e ) ;
45- }
46- }
47- } ;
48-
492var $User = ( function ( ) {
503 const platform = navigator . platform ;
514 const userAgent = navigator . userAgent ;
You can’t perform that action at this time.
0 commit comments