cryptpad/www/bounce/main.js
2018-06-12 16:50:38 +02:00

15 lines
586 B
JavaScript

define(['/common/config.js'], function (ApiConfig) {
if (ApiConfig.httpSafeOrigin !== window.location.origin) {
window.alert('The bounce application must only be used from the sandbox domain, ' +
'please report this issue on https://github.com/xwiki-labs/cryptpad');
return;
}
var bounceTo = decodeURIComponent(window.location.hash.slice(1));
if (!bounceTo) {
window.alert('The bounce application must only be used with a valid href to visit');
return;
}
window.opener = null;
window.location.href = bounceTo;
});