console
This commit is contained in:
@@ -1,4 +1,13 @@
|
|||||||
(() => {
|
(() => {
|
||||||
|
window.addEventListener(
|
||||||
|
'beforeunload',
|
||||||
|
(e) => {
|
||||||
|
e.stopImmediatePropagation();
|
||||||
|
e.preventDefault();
|
||||||
|
e.returnValue = undefined;
|
||||||
|
},
|
||||||
|
{ capture: true }
|
||||||
|
);
|
||||||
const tabBar = document.querySelector('[data-console-tab-bar]');
|
const tabBar = document.querySelector('[data-console-tab-bar]');
|
||||||
const tabPanels = document.querySelector('[data-console-tab-panels]');
|
const tabPanels = document.querySelector('[data-console-tab-panels]');
|
||||||
if (!tabBar || !tabPanels) return;
|
if (!tabBar || !tabPanels) return;
|
||||||
@@ -98,6 +107,9 @@
|
|||||||
|
|
||||||
iframe.addEventListener('load', () => {
|
iframe.addEventListener('load', () => {
|
||||||
try {
|
try {
|
||||||
|
if (iframe.contentWindow) {
|
||||||
|
iframe.contentWindow.onbeforeunload = null;
|
||||||
|
}
|
||||||
const doc = iframe.contentWindow.document;
|
const doc = iframe.contentWindow.document;
|
||||||
['keydown', 'mousedown', 'wheel', 'touchstart'].forEach((evt) => {
|
['keydown', 'mousedown', 'wheel', 'touchstart'].forEach((evt) => {
|
||||||
doc.addEventListener(evt, markActive, { passive: true });
|
doc.addEventListener(evt, markActive, { passive: true });
|
||||||
|
|||||||
Reference in New Issue
Block a user