mirror of
https://github.com/ION606/browser-chromium.git
synced 2026-05-14 22:26:56 +00:00
15 lines
542 B
JavaScript
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);
|
|
}; |