mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
Browser: Add a banner to tabs controlled by WebDriver
From https://www.w3.org/TR/webdriver/#security: It is also suggested that user agents make an effort to visually distinguish a user agent session that is under control of WebDriver from those used for normal browsing sessions. This can be done through a browser chrome element such as a “door hanger”, colorful decoration of the OS window, or some widget element that is prevalent in the window so that it easy to identify automation windows.
This commit is contained in:
parent
3ed1a14371
commit
b667cd69ca
Notes:
sideshowbarker
2024-07-17 04:46:53 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/b667cd69ca Pull-request: https://github.com/SerenityOS/serenity/pull/15933 Reviewed-by: https://github.com/trflynn89 ✅
2 changed files with 22 additions and 0 deletions
|
@ -668,6 +668,8 @@ void Tab::hide_event(GUI::HideEvent&)
|
|||
void Tab::enable_webdriver_mode()
|
||||
{
|
||||
m_web_content_view->set_is_webdriver_active(true);
|
||||
auto& webdriver_banner = *find_descendant_of_type_named<GUI::Widget>("webdriver_banner");
|
||||
webdriver_banner.set_visible(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,6 +11,26 @@
|
|||
}
|
||||
}
|
||||
|
||||
@GUI::Frame {
|
||||
name: "webdriver_banner"
|
||||
shape: "Box"
|
||||
shadow: "Sunken"
|
||||
thickness: 1
|
||||
preferred_height: "shrink"
|
||||
foreground_role: "TooltipText"
|
||||
background_role: "Tooltip"
|
||||
fill_with_background_color: true
|
||||
visible: false
|
||||
layout: @GUI::HorizontalBoxLayout {
|
||||
margins: [0, 4]
|
||||
}
|
||||
|
||||
@GUI::Label {
|
||||
text: "This Browser window is controlled by WebDriver."
|
||||
text_alignment: "CenterLeft"
|
||||
}
|
||||
}
|
||||
|
||||
@GUI::Widget {
|
||||
name: "webview_container"
|
||||
layout: @GUI::VerticalBoxLayout {}
|
||||
|
|
Loading…
Reference in a new issue