mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 07:22:45 +00:00 
			
		
		
		
	LibWeb: Always allow scripting in workers for now
Workers don't have a document, so we can't ask them if scripting is enabled or not. This is not the right long-term fix, but it fixes an assertion when trying to query the missing responsible document of a web worker.
This commit is contained in:
		
							parent
							
								
									e97cc671ea
								
							
						
					
					
						commit
						cb15132146
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		|  | @ -244,6 +244,10 @@ bool EnvironmentSettingsObject::is_scripting_enabled() const | |||
|     // The user agent supports scripting.
 | ||||
|     // NOTE: This is always true in LibWeb :^)
 | ||||
| 
 | ||||
|     // FIXME: Do the right thing for workers.
 | ||||
|     if (!is<HTML::Window>(m_realm_execution_context->realm->global_object())) | ||||
|         return true; | ||||
| 
 | ||||
|     // The user has not disabled scripting for settings at this time. (User agents may provide users with the option to disable scripting globally, or in a finer-grained manner, e.g., on a per-origin basis, down to the level of individual environment settings objects.)
 | ||||
|     auto document = const_cast<EnvironmentSettingsObject&>(*this).responsible_document(); | ||||
|     VERIFY(document); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling