Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blocked pop-ups fix (Part 2) #292

Merged
merged 2 commits into from
Dec 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion app/services/services/tab-webcontents/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ export class TabWebContentsServiceImpl extends TabWebContentsService implements
let noLocation = false;
let noToolbar = false;
let noMenubar = false;
let popup = false;
const trueValues = ['yes', 'true', '1'];
const falseValues = ['no', 'false', '0'];
for (const featureString of details.features.split(',')) {
const pair = featureString.split('=');
Expand All @@ -240,12 +242,23 @@ export class TabWebContentsServiceImpl extends TabWebContentsService implements
else if (key === 'menubar') {
noMenubar = falseValues.includes(value);
}
else if (key === 'popup') {
popup = trueValues.includes(value);
}
}
}
if (noLocation && noToolbar && noMenubar) {
if (popup
|| noLocation && noToolbar && noMenubar) {
return true;
}
}

if (details.frameName) {
if (!['_self', '_blank', '_parent', '_top'].includes(details.frameName)) {
return true;
}
}

return false;
}

Expand Down