mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-24 02:08:58 +00:00
UI/AppKit: Disable popup blocking on startup if --allow-popups
is set
This commit is contained in:
parent
74e12a9c97
commit
256b56dde8
Notes:
github-actions[bot]
2024-09-07 09:38:36 +00:00
Author: https://github.com/tcl3
Commit: 256b56dde8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1262
3 changed files with 15 additions and 1 deletions
|
@ -188,6 +188,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
[self.managed_tabs addObject:controller];
|
[self.managed_tabs addObject:controller];
|
||||||
|
[controller onCreateNewTab];
|
||||||
return controller;
|
return controller;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,11 +35,14 @@ struct TabSettings {
|
||||||
|
|
||||||
- (void)onTitleChange:(ByteString const&)title;
|
- (void)onTitleChange:(ByteString const&)title;
|
||||||
|
|
||||||
|
- (void)onCreateNewTab;
|
||||||
|
|
||||||
- (void)navigateBack:(id)sender;
|
- (void)navigateBack:(id)sender;
|
||||||
- (void)navigateForward:(id)sender;
|
- (void)navigateForward:(id)sender;
|
||||||
- (void)reload:(id)sender;
|
- (void)reload:(id)sender;
|
||||||
- (void)clearHistory;
|
- (void)clearHistory;
|
||||||
|
|
||||||
|
- (void)setPopupBlocking:(BOOL)block_popups;
|
||||||
- (void)debugRequest:(ByteString const&)request argument:(ByteString const&)argument;
|
- (void)debugRequest:(ByteString const&)request argument:(ByteString const&)argument;
|
||||||
|
|
||||||
- (void)focusLocationToolbarItem;
|
- (void)focusLocationToolbarItem;
|
||||||
|
|
|
@ -139,6 +139,11 @@ static NSString* const TOOLBAR_TAB_OVERVIEW_IDENTIFIER = @"ToolbarTabOverviewIde
|
||||||
m_title = title;
|
m_title = title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)onCreateNewTab
|
||||||
|
{
|
||||||
|
[self setPopupBlocking:m_settings.block_popups];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)zoomIn:(id)sender
|
- (void)zoomIn:(id)sender
|
||||||
{
|
{
|
||||||
[[[self tab] web_view] zoomIn];
|
[[[self tab] web_view] zoomIn];
|
||||||
|
@ -348,7 +353,12 @@ static NSString* const TOOLBAR_TAB_OVERVIEW_IDENTIFIER = @"ToolbarTabOverviewIde
|
||||||
- (void)togglePopupBlocking:(id)sender
|
- (void)togglePopupBlocking:(id)sender
|
||||||
{
|
{
|
||||||
m_settings.block_popups = !m_settings.block_popups;
|
m_settings.block_popups = !m_settings.block_popups;
|
||||||
[self debugRequest:"block-pop-ups" argument:m_settings.block_popups ? "on" : "off"];
|
[self setPopupBlocking:m_settings.block_popups];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setPopupBlocking:(BOOL)block_popups
|
||||||
|
{
|
||||||
|
[self debugRequest:"block-pop-ups" argument:block_popups ? "on" : "off"];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)toggleSameOriginPolicy:(id)sender
|
- (void)toggleSameOriginPolicy:(id)sender
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue