summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-03-30 23:23:14 +0100
committerAndreas Kling <kling@serenityos.org>2022-03-31 17:08:38 +0200
commit780e5441b4aa7f6b14921429f0841bc23ebdc7dc (patch)
treef4075c5ea651e9eba16e2f1ecf97f354485ffb6e
parent7bdbac7fd93391bd7bd8947e1cad81bdfdd879ee (diff)
downloadserenity-780e5441b4aa7f6b14921429f0841bc23ebdc7dc.zip
WebContent: Add plumbing for 'is scripting enabled' setting
-rw-r--r--Userland/Services/WebContent/ConnectionFromClient.cpp5
-rw-r--r--Userland/Services/WebContent/ConnectionFromClient.h1
-rw-r--r--Userland/Services/WebContent/PageHost.cpp5
-rw-r--r--Userland/Services/WebContent/PageHost.h1
-rw-r--r--Userland/Services/WebContent/WebContentServer.ipc2
5 files changed, 13 insertions, 1 deletions
diff --git a/Userland/Services/WebContent/ConnectionFromClient.cpp b/Userland/Services/WebContent/ConnectionFromClient.cpp
index 20a975d959..0c0f93be38 100644
--- a/Userland/Services/WebContent/ConnectionFromClient.cpp
+++ b/Userland/Services/WebContent/ConnectionFromClient.cpp
@@ -459,4 +459,9 @@ void ConnectionFromClient::set_has_focus(bool has_focus)
m_page_host->set_has_focus(has_focus);
}
+void ConnectionFromClient::set_is_scripting_enabled(bool is_scripting_enabled)
+{
+ m_page_host->set_is_scripting_enabled(is_scripting_enabled);
+}
+
}
diff --git a/Userland/Services/WebContent/ConnectionFromClient.h b/Userland/Services/WebContent/ConnectionFromClient.h
index abcfa96c18..f0a4a3f34b 100644
--- a/Userland/Services/WebContent/ConnectionFromClient.h
+++ b/Userland/Services/WebContent/ConnectionFromClient.h
@@ -61,6 +61,7 @@ private:
virtual void set_content_filters(Vector<String> const&) override;
virtual void set_preferred_color_scheme(Web::CSS::PreferredColorScheme const&) override;
virtual void set_has_focus(bool) override;
+ virtual void set_is_scripting_enabled(bool) override;
virtual void js_console_input(String const&) override;
virtual void run_javascript(String const&) override;
diff --git a/Userland/Services/WebContent/PageHost.cpp b/Userland/Services/WebContent/PageHost.cpp
index 5a23732afc..de45226257 100644
--- a/Userland/Services/WebContent/PageHost.cpp
+++ b/Userland/Services/WebContent/PageHost.cpp
@@ -62,6 +62,11 @@ void PageHost::set_preferred_color_scheme(Web::CSS::PreferredColorScheme color_s
document->invalidate_style();
}
+void PageHost::set_is_scripting_enabled(bool is_scripting_enabled)
+{
+ page().set_is_scripting_enabled(is_scripting_enabled);
+}
+
Web::Layout::InitialContainingBlock* PageHost::layout_root()
{
auto* document = page().top_level_browsing_context().active_document();
diff --git a/Userland/Services/WebContent/PageHost.h b/Userland/Services/WebContent/PageHost.h
index 4aeded7d50..6ccc38d04c 100644
--- a/Userland/Services/WebContent/PageHost.h
+++ b/Userland/Services/WebContent/PageHost.h
@@ -33,6 +33,7 @@ public:
void set_should_show_line_box_borders(bool b) { m_should_show_line_box_borders = b; }
void set_has_focus(bool);
+ void set_is_scripting_enabled(bool);
private:
// ^PageClient
diff --git a/Userland/Services/WebContent/WebContentServer.ipc b/Userland/Services/WebContent/WebContentServer.ipc
index b5a10d8711..a4b9b01122 100644
--- a/Userland/Services/WebContent/WebContentServer.ipc
+++ b/Userland/Services/WebContent/WebContentServer.ipc
@@ -44,7 +44,7 @@ endpoint WebContentServer
set_content_filters(Vector<String> filters) =|
set_preferred_color_scheme(Web::CSS::PreferredColorScheme color_scheme) =|
-
set_has_focus(bool has_focus) =|
+ set_is_scripting_enabled(bool is_scripting_enabled) =|
}