File tree 1 file changed +16
-8
lines changed
Assets/WebGLTemplates/Develop
1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -21,14 +21,6 @@ if (getCookie("addTimestamp") === "false") {
21
21
addTimestamp = false ;
22
22
}
23
23
24
- const urlParams = new URLSearchParams ( window . location . search ) ;
25
- const debugParam = urlParams . get ( 'debug' ) ;
26
- const debug = debugParam === 'true' ;
27
-
28
- initializeToggleButton ( debug ) ;
29
- initializeDebugConsole ( ) ;
30
-
31
-
32
24
function setCookie ( cname , cvalue , exdays ) {
33
25
const d = new Date ( ) ;
34
26
d . setTime ( d . getTime ( ) + ( exdays * 24 * 60 * 60 * 1000 ) ) ;
@@ -609,3 +601,19 @@ function refreshTrackingDiv() {
609
601
innerHtml += '</dl>' ;
610
602
trackingDiv . innerHTML = innerHtml ;
611
603
}
604
+
605
+ // Polyfill for older browsers
606
+ if ( ! String . prototype . replaceAll ) {
607
+ String . prototype . replaceAll = function ( str , newStr ) {
608
+ if ( str === '?' )
609
+ str = '\\\\?' ;
610
+ return this . replace ( str instanceof RegExp ? str : new RegExp ( str , 'g' ) , newStr ) ;
611
+ }
612
+ }
613
+
614
+ const urlParams = new URLSearchParams ( window . location . search ) ;
615
+ const debugParam = urlParams . get ( 'debug' ) ;
616
+ const debug = debugParam === 'true' ;
617
+
618
+ initializeToggleButton ( debug ) ;
619
+ initializeDebugConsole ( ) ;
You can’t perform that action at this time.
0 commit comments