This repository was archived by the owner on Dec 31, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change 53
53
// test for array
54
54
function is_array ( arr ) { return Object . prototype . toString . call ( arr ) == "[object Array]" ; }
55
55
56
- // test if script URL is on same domain as page or not
57
- function same_domain ( src ) { return ( canonical_uri ( src , root_domain ) . indexOf ( root_domain ) == 0 ) ; }
58
-
59
56
// make script URL absolute/canonical
60
57
function canonical_uri ( src , base_path ) {
61
58
var protocol_relative_regex = / ^ \/ \/ [ ^ \/ ] / , absolute_regex = / ^ \w + \: \/ \/ / ;
183
180
script . src = src ;
184
181
append_to . insertBefore ( script , append_to . firstChild ) ;
185
182
}
186
- // same-domain, so use XHR+script injection
187
- else if ( same_domain ( src ) && chain_opts [ _UseLocalXHR ] ) {
183
+ // same-domain and XHR allowed , so use XHR+script injection
184
+ else if ( src . indexOf ( root_domain ) == 0 && chain_opts [ _UseLocalXHR ] ) {
188
185
var xhr = XMLHttpRequest ? new XMLHttpRequest ( ) : ( ActiveXObject ? new ActiveXObject ( "Microsoft.XMLHTTP" ) : null ) ;
189
186
/*!START_DEBUG*/ if ( chain_opts [ _Debug ] ) log_msg ( "start script preload (xhr): " + src ) ; /*!END_DEBUG*/
190
187
xhr . onreadystatechange = function ( ) {
You can’t perform that action at this time.
0 commit comments