mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 09:42:45 +00:00 
			
		
		
		
	LibWeb: Allow reloading the current page with location.reload()
This commit is contained in:
		
							parent
							
								
									71007f6ebb
								
							
						
					
					
						commit
						3b11e471bd
					
				
					 5 changed files with 32 additions and 3 deletions
				
			
		|  | @ -45,6 +45,8 @@ LocationObject::LocationObject() | |||
|     put_native_property("hash", hash_getter, nullptr); | ||||
|     put_native_property("search", search_getter, nullptr); | ||||
|     put_native_property("protocol", protocol_getter, nullptr); | ||||
| 
 | ||||
|     put_native_function("reload", reload); | ||||
| } | ||||
| 
 | ||||
| LocationObject::~LocationObject() | ||||
|  | @ -110,6 +112,13 @@ JS::Value LocationObject::protocol_getter(JS::Interpreter& interpreter) | |||
|     return JS::js_string(interpreter, builder.to_string()); | ||||
| } | ||||
| 
 | ||||
| JS::Value LocationObject::reload(JS::Interpreter& interpreter) | ||||
| { | ||||
|     auto& window = static_cast<WindowObject&>(interpreter.global_object()); | ||||
|     window.impl().did_call_location_reload({}); | ||||
|     return JS::js_undefined(); | ||||
| } | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling