Skip to content

Commit fdd1284

Browse files
committed
manual merge of DuendeArchive#245
1 parent 84e0aad commit fdd1284

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

‎index.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export const CordovaPopupNavigator = require('./src/CordovaPopupNavigator');
1313
export const CordovaIFrameNavigator = require('./src/CordovaIFrameNavigator');
1414
export const CheckSessionIFrame = require('./src/CheckSessionIFrame');
1515
export const TokenRevocationClient = require('./src/TokenRevocationClient');
16+
export const Global = require('./src/Global');
1617

1718
export default {
1819
Log,
@@ -26,5 +27,6 @@ export default {
2627
CordovaPopupNavigator,
2728
CordovaIFrameNavigator,
2829
CheckSessionIFrame,
29-
TokenRevocationClient
30+
TokenRevocationClient,
31+
Global
3032
};

‎src/Global.js‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const timer = {
1111
};
1212

1313
let testing = false;
14+
let request = null;
1415

1516
export default class Global {
1617

@@ -23,21 +24,29 @@ export default class Global {
2324
return location;
2425
}
2526
}
27+
2628
static get localStorage() {
2729
if (!testing) {
2830
return localStorage;
2931
}
3032
}
33+
3134
static get sessionStorage() {
3235
if (!testing) {
3336
return sessionStorage;
3437
}
3538
}
39+
40+
static setXMLHttpRequest(newRequest) {
41+
request = newRequest;
42+
}
43+
3644
static get XMLHttpRequest() {
3745
if (!testing) {
38-
return XMLHttpRequest;
46+
return request || XMLHttpRequest;
3947
}
4048
}
49+
4150
static get timer() {
4251
if (!testing) {
4352
return timer;

0 commit comments

Comments
 (0)