Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function main() {
const query = querystring.parse(global.location.search.slice(1));
if (query.resize === "true") {
require("iframe-resizer").iframeResizerContentWindow;
}
if (query.reload === "true") {
const ws = new WebSocketClient({
src: `ws://${global.location.host}/api/`,
reconnect: true,
interval: 1000
});
ws.open();
ws.onMessage(envelope => {
const message = ARSON.parse(envelope.data);
if (message.type === "start") {
window.location.reload();
}