<a id="linkToReplace1" role="button" ng-click="App.openModal('#donation_modal'); App.donateSum = 100;" translate="navbar.balance" translate-values="{amount: App.user.balance, currency: 'RUB'}">Баланс: 986 RUB</a>
let a = document.getElementById('linkToReplace1');
let bc = new BroadcastChannel('notifier-broadcast');
let bc_config = {
newWin: 'new_window',
block: 'window_restrict'
};
function newtab() {
return new Promise(function (res, rej) {
try {
bc.postMessage(bc_config.newWin);
bc.onmessage = event => {
if (event.data == bc_config.block) res(false);
}
setTimeout(() => {
bc.onmessage = () => bc.postMessage(bc_config.block);
res(true);
}, 1500);
} catch (e) {
rej(e);
}
});
}
(async function() {
'use strict';
if (!await newtab()) return;
// ...
}
for (...) {
if (i >= NAMES.length * SURNAMES.length) break;
}