1
- const html_node = document . documentElement ;
1
+ const html_node = document . documentElement ,
2
+ base_url = "https://bitrequest.github.io" ;
2
3
3
4
document . addEventListener ( "DOMContentLoaded" , function ( ) {
4
5
checkout ( ) ;
@@ -12,11 +13,9 @@ function checkout() {
12
13
document . addEventListener ( "click" , function ( e ) {
13
14
const target = e . target ;
14
15
if ( ! target . matches ( ".br_checkout" ) ) return ;
15
-
16
16
e . preventDefault ( ) ;
17
17
const checkout_url = target . getAttribute ( "href" ) ,
18
18
br_frame = document . querySelector ( "#br_framebox iframe" ) ;
19
-
20
19
if ( br_frame ) {
21
20
showloader ( ) ;
22
21
br_frame . setAttribute ( "src" , checkout_url ) ;
@@ -39,7 +38,11 @@ function append_iframe(framesrc) {
39
38
function iframe_loaded ( ) {
40
39
const requestframe = document . querySelector ( "#br_framebox iframe" ) ;
41
40
requestframe . addEventListener ( "load" , function ( ) {
42
- if ( requestframe . getAttribute ( "src" ) ) {
41
+ const frame_source = requestframe . getAttribute ( "src" ) ;
42
+ if ( frame_source ) {
43
+ if ( frame_source === base_url ) {
44
+ return
45
+ }
43
46
showframe ( ) ;
44
47
}
45
48
} ) ;
@@ -92,7 +95,7 @@ function closeframe() {
92
95
html_node . classList . remove ( "showframe" ) ;
93
96
const iframe = document . querySelector ( "#br_framebox iframe" ) ;
94
97
if ( iframe ) {
95
- iframe . removeAttribute ( "src" ) ;
98
+ iframe . setAttribute ( "src" , base_url ) ;
96
99
}
97
100
} , 400 ) ;
98
101
}
@@ -128,11 +131,11 @@ function keyup() {
128
131
if ( e . key === "Escape" || e . keyCode === 27 ) {
129
132
if ( html_node . classList . contains ( "slide_loader" ) ) {
130
133
closeloader ( ) ;
131
- return false ;
134
+ return
132
135
}
133
136
if ( html_node . classList . contains ( "showframe" ) ) {
134
137
closeframe_confirm ( ) ;
135
- return false ;
138
+ return
136
139
}
137
140
}
138
141
} ) ;
0 commit comments