Files
browser-chromium/JS/clientAdBlock.js
T
2024-11-01 20:55:18 -04:00

15 lines
542 B
JavaScript

// save the original window.open function
const originalWindowOpen = window.open;
// override the window.open function
window.open = function (url, target, features) {
console.log('A new window is attempting to open:');
console.log('URL:', url);
console.log('Target:', target);
console.log('Features:', features);
window.electronAPI.checkperms(window.location.hostname);
// call the original window.open function if you want the popup to proceed
return originalWindowOpen.call(window, url, target, features);
};