mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 10:22:45 +00:00 
			
		
		
		
	 fbf9cb3387
			
		
	
	
		fbf9cb3387
		
	
	
	
	
		
			
			Instead of creating a new global object and proxying everything through it, we now evaluate console inputs inside a `with` environment. This seems to match the behavior of WebKit and Gecko in my basic testing, and removes the ConsoleGlobalObject which has been a source of confusion and invalid downcasts. The globals now live in a class called ConsoleGlobalObjectExtensions (renamed from ConsoleGlobalObject since it's no longer a global object). To make this possible, I had to add a way to override the initial lexical environment when calling JS::Interpreter::run(). This is plumbed via Web::HTML::ClassicScript::run().
		
			
				
	
	
		
			32 lines
		
	
	
	
		
			896 B
		
	
	
	
		
			CMake
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
	
		
			896 B
		
	
	
	
		
			CMake
		
	
	
	
	
	
| serenity_component(
 | |
|     WebContent
 | |
|     TARGETS WebContent
 | |
|     DEPENDS ImageDecoder RequestServer WebSocket
 | |
| )
 | |
| 
 | |
| compile_ipc(WebContentServer.ipc WebContentServerEndpoint.h)
 | |
| compile_ipc(WebContentClient.ipc WebContentClientEndpoint.h)
 | |
| 
 | |
| compile_ipc(WebDriverClient.ipc WebDriverClientEndpoint.h)
 | |
| compile_ipc(WebDriverServer.ipc WebDriverServerEndpoint.h)
 | |
| 
 | |
| set(SOURCES
 | |
|     ConnectionFromClient.cpp
 | |
|     ConsoleGlobalEnvironmentExtensions.cpp
 | |
|     ImageCodecPluginSerenity.cpp
 | |
|     PageHost.cpp
 | |
|     WebContentConsoleClient.cpp
 | |
|     WebDriverConnection.cpp
 | |
|     main.cpp
 | |
| )
 | |
| 
 | |
| set(GENERATED_SOURCES
 | |
|     WebContentClientEndpoint.h
 | |
|     WebContentServerEndpoint.h
 | |
|     WebDriverClientEndpoint.h
 | |
|     WebDriverServerEndpoint.h
 | |
| )
 | |
| 
 | |
| serenity_bin(WebContent)
 | |
| target_link_libraries(WebContent PRIVATE LibCore LibIPC LibGfx LibImageDecoderClient LibJS LibWebView LibWeb LibLocale LibMain)
 | |
| link_with_locale_data(WebContent)
 |