File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
MTA10/mods/shared_logic/lua Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -55,14 +55,24 @@ int CLuaFunctionDefs::CreateBrowser ( lua_State* luaVM )
5555
5656int CLuaFunctionDefs::RequestBrowserDomains ( lua_State* luaVM )
5757{
58- // bool requestBrowserDomains ( table domains )
59- std::vector<SString> pages;
58+ // bool requestBrowserDomains ( table domains, bool isURL )
59+ std::vector<SString> pages; bool bIsURL;
6060
6161 CScriptArgReader argStream ( luaVM );
6262 argStream.ReadStringTable ( pages );
63+ argStream.ReadBool ( bIsURL, false );
6364
6465 if ( !argStream.HasErrors () )
6566 {
67+ // Convert to domains if we got a list of URLs
68+ if ( bIsURL )
69+ {
70+ for ( auto & strURL : pages )
71+ {
72+ strURL = g_pCore->GetWebCore ()->GetDomainFromURL ( strURL );
73+ }
74+ }
75+
6676 g_pCore->GetWebCore ()->RequestPages ( pages );
6777 // Todo: Add a callback or event to check if the pagerequest dialog was successfully done
6878 lua_pushboolean ( luaVM, true );
You can’t perform that action at this time.
0 commit comments