| 
									
										
										
										
											2023-11-23 12:22:23 -05:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2024-08-19 12:11:39 -04:00
										 |  |  |  * Copyright (c) 2023-2024, Tim Flynn <trflynn89@serenityos.org> | 
					
						
							| 
									
										
										
										
											2023-11-23 12:22:23 -05:00
										 |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <LibJS/Forward.h>
 | 
					
						
							|  |  |  | #include <LibWeb/Bindings/PlatformObject.h>
 | 
					
						
							| 
									
										
										
										
											2024-02-18 13:59:28 -05:00
										 |  |  | #include <LibWeb/WebIDL/Types.h>
 | 
					
						
							| 
									
										
										
										
											2023-11-23 12:22:23 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace Web::Internals { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Inspector final : public Bindings::PlatformObject { | 
					
						
							|  |  |  |     WEB_PLATFORM_OBJECT(Inspector, Bindings::PlatformObject); | 
					
						
							|  |  |  |     JS_DECLARE_ALLOCATOR(Inspector); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |     virtual ~Inspector() override; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     void inspector_loaded(); | 
					
						
							|  |  |  |     void inspect_dom_node(i32 node_id, Optional<i32> const& pseudo_element); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-03 11:49:08 -05:00
										 |  |  |     void set_dom_node_text(i32 node_id, String const& text); | 
					
						
							|  |  |  |     void set_dom_node_tag(i32 node_id, String const& tag); | 
					
						
							| 
									
										
										
										
											2023-12-05 16:43:14 -05:00
										 |  |  |     void add_dom_node_attributes(i32 node_id, JS::NonnullGCPtr<DOM::NamedNodeMap> attributes); | 
					
						
							| 
									
										
										
										
											2024-02-18 13:59:28 -05:00
										 |  |  |     void replace_dom_node_attribute(i32 node_id, WebIDL::UnsignedLongLong attribute_index, JS::NonnullGCPtr<DOM::NamedNodeMap> replacement_attributes); | 
					
						
							| 
									
										
										
										
											2023-12-03 11:49:08 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-18 13:59:28 -05:00
										 |  |  |     void request_dom_tree_context_menu(i32 node_id, i32 client_x, i32 client_y, String const& type, Optional<String> const& tag, Optional<WebIDL::UnsignedLongLong> const& attribute_index); | 
					
						
							| 
									
										
										
										
											2023-12-05 14:47:56 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-06 13:22:16 -04:00
										 |  |  |     void request_cookie_context_menu(WebIDL::UnsignedLongLong cookie_index, i32 client_x, i32 client_y); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-23 11:18:35 +01:00
										 |  |  |     void request_style_sheet_source(String const& type, Optional<i32> const& dom_node_unique_id, Optional<String> const& url); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-30 19:27:32 -05:00
										 |  |  |     void execute_console_script(String const& script); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-19 12:11:39 -04:00
										 |  |  |     void export_inspector_html(String const& html); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-23 12:22:23 -05:00
										 |  |  | private: | 
					
						
							|  |  |  |     explicit Inspector(JS::Realm&); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-22 10:16:23 +01:00
										 |  |  |     PageClient& inspector_page_client() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-23 12:22:23 -05:00
										 |  |  |     virtual void initialize(JS::Realm&) override; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |