DNaumov Posted July 5, 2022 Share Posted July 5, 2022 (edited) Hello, I have an error related to CEF, my created browser refuses to open localhost. I create a browser, load the url in it - "http://localhost:3000 ", but nothing happens, the browser just doesn't appear. I also tried to enter other urls - "http://127.0.0.1:3000", "192.168.0.**:3000" The browser does not open in any of the options. Although if I set for example the url - "http://google.com ", then the browser immediately opens google. I have suspicions that the loadBrowserURL() function. He just can't handle the IP, he needs the domain. I will be grateful if someone can help. Here is my code ( client.lua ) : local browser = createBrowser ( 1920, 1080, false, false ); function setURL( ) loadBrowserURL ( source, "http://localhost:3000" ); end; addEventHandler ( "onClientBrowserCreated", browser, setURL ); addEventHandler( "onClientRender", root, function() dxDrawImage( 0, 0, 1920, 1080, browser ); end ); Edited July 5, 2022 by DNaumov Link to comment
Fierelier Posted July 5, 2022 Share Posted July 5, 2022 This most likely on purpose, for security reasons, so servers can't make evil scripts that go through your local servers and grab data that may be private. Link to comment
Tails Posted July 5, 2022 Share Posted July 5, 2022 (edited) You need to whitelist the domain with requestBrowserDomains https://wiki.multitheftauto.com/wiki/RequestBrowserDomains Edited July 5, 2022 by Tails 1 Link to comment
DNaumov Posted July 5, 2022 Author Share Posted July 5, 2022 14 minutes ago, Tails said: Вам нужно внести домен в белый список с помощью requestBrowserDomains https://wiki.multitheftauto.com/wiki/RequestBrowserDomains Thank you very much, it really helped! 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now