mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:57:44 +00:00
Browser+LibWebView+WebDriver: Connect WebDriver to WebContent
First, this moves the WebDriver socket to the /tmp/websocket/ directory, as WebDriver now creates multiple sockets per session. Those sockets are now created with Core::LocalServer rather than manually setting up the listening sockets (this was an existing FIXME which resolved some issues I was hitting with creating a second listening socket). WebDriver passes both socket paths to Browser via command line. Browser continues to connect itself via one socket path, then forwards the other socket path to the WebContent process created by the OOPWV. WebContent then connects to WebDriver over this path. WebContent will temporarily set the navigator.webdriver flag to true after connecting to WebDriver. This will soon be moved to its own IPC to be sent by WebDriver.
This commit is contained in:
parent
6b014489d4
commit
50ae1ad18a
11 changed files with 151 additions and 35 deletions
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
#include <LibCore/ArgsParser.h>
|
||||
#include <LibCore/Directory.h>
|
||||
#include <LibCore/EventLoop.h>
|
||||
#include <LibCore/System.h>
|
||||
#include <LibCore/TCPServer.h>
|
||||
|
@ -35,6 +36,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
return 1;
|
||||
}
|
||||
|
||||
TRY(Core::System::pledge("stdio accept cpath rpath recvfd inet unix proc exec fattr"));
|
||||
|
||||
TRY(Core::Directory::create("/tmp/webdriver"sv, Core::Directory::CreateDirectories::Yes));
|
||||
TRY(Core::System::pledge("stdio accept rpath recvfd inet unix proc exec fattr"));
|
||||
|
||||
Core::EventLoop loop;
|
||||
|
@ -67,7 +71,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(Core::System::unveil("/bin/Browser", "rx"));
|
||||
TRY(Core::System::unveil("/etc/timezone", "r"));
|
||||
TRY(Core::System::unveil("/res/icons", "r"));
|
||||
TRY(Core::System::unveil("/tmp", "rwc"));
|
||||
TRY(Core::System::unveil("/tmp/webdriver", "rwc"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
TRY(Core::System::pledge("stdio accept rpath recvfd unix proc exec fattr"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue