diff --git a/static/js/codeRunner.js b/static/js/codeRunner.js index 76b67f9..d0336b9 100644 --- a/static/js/codeRunner.js +++ b/static/js/codeRunner.js @@ -362,6 +362,7 @@ export function runHTML(code, panel) { addCloseBtn(panel); return; } + try { win.opener = null; } catch (_) {} win.document.open(); win.document.write(code); win.document.close(); diff --git a/static/js/compare/index.js b/static/js/compare/index.js index e6c00ae..f372078 100644 --- a/static/js/compare/index.js +++ b/static/js/compare/index.js @@ -1090,6 +1090,7 @@ function _exportPrint() { // the system print dialog — user can pick "Save as PDF" from there. const w = window.open('', '_blank'); if (!w) return; + try { w.opener = null; } catch (_) {} const escape = (s) => s.replace(/&/g, '&').replace(//g, '>'); const html = '