| 
									
										
										
										
											2022-10-08 20:53:08 -06:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2022, Andrew Kaster <akaster@serenityos.org> | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-20 13:44:27 +13:00
										 |  |  | #include <AK/String.h>
 | 
					
						
							| 
									
										
										
										
											2022-10-08 20:53:08 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace Web::HTML { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class NavigatorIDMixin { | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |     // WARNING: Any information in this API that varies from user to user can be used to profile the user. In fact, if
 | 
					
						
							|  |  |  |     // enough such information is available, a user can actually be uniquely identified. For this reason, user agent
 | 
					
						
							|  |  |  |     // implementers are strongly urged to include as little information in this API as possible.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-appcodename
 | 
					
						
							| 
									
										
										
										
											2023-11-20 13:44:27 +13:00
										 |  |  |     String app_code_name() const { return "Mozilla"_string; } | 
					
						
							| 
									
										
										
										
											2022-10-08 20:53:08 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-appcodename
 | 
					
						
							| 
									
										
										
										
											2023-11-20 13:44:27 +13:00
										 |  |  |     String app_name() const { return "Netscape"_string; } | 
					
						
							| 
									
										
										
										
											2022-10-08 20:53:08 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-appversion
 | 
					
						
							| 
									
										
										
										
											2023-11-20 13:44:27 +13:00
										 |  |  |     String app_version() const; | 
					
						
							| 
									
										
										
										
											2022-10-08 20:53:08 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-platform
 | 
					
						
							| 
									
										
										
										
											2023-11-20 13:44:27 +13:00
										 |  |  |     String platform() const; | 
					
						
							| 
									
										
										
										
											2022-10-08 20:53:08 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-product
 | 
					
						
							| 
									
										
										
										
											2023-11-20 13:44:27 +13:00
										 |  |  |     String product() const { return "Gecko"_string; } | 
					
						
							| 
									
										
										
										
											2022-10-08 20:53:08 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-productsub
 | 
					
						
							| 
									
										
										
										
											2024-07-02 01:04:40 +01:00
										 |  |  |     String product_sub() const; | 
					
						
							| 
									
										
										
										
											2022-10-08 20:53:08 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-useragent
 | 
					
						
							| 
									
										
										
										
											2023-11-20 13:44:27 +13:00
										 |  |  |     String user_agent() const; | 
					
						
							| 
									
										
										
										
											2022-10-08 20:53:08 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-vendor
 | 
					
						
							| 
									
										
										
										
											2024-07-02 01:04:40 +01:00
										 |  |  |     String vendor() const; | 
					
						
							| 
									
										
										
										
											2022-10-08 20:53:08 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-vendorsub
 | 
					
						
							| 
									
										
										
										
											2023-11-20 13:44:27 +13:00
										 |  |  |     String vendor_sub() const { return String {}; } | 
					
						
							| 
									
										
										
										
											2022-10-08 20:53:08 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-02 01:04:40 +01:00
										 |  |  |     // FIXME: If the navigator compatibility mode is Gecko, then the user agent must also support the following partial interface:
 | 
					
						
							| 
									
										
										
										
											2022-10-08 20:53:08 -06:00
										 |  |  |     //       bool taint_enabled()
 | 
					
						
							| 
									
										
										
										
											2023-12-16 17:49:34 +03:30
										 |  |  |     //       ByteString oscpu()
 | 
					
						
							| 
									
										
										
										
											2022-10-08 20:53:08 -06:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |