Jump to content

Cannot load local resource to WebBrowser


Seeroy

Recommended Posts

Hello. I`m writing login/register plugin using CEF. But i cant load local page to WebBrowser (but, for example, i can load youtube.com)

My code

local screenWidth, screenHeight = guiGetScreenSize()
local webBrowser = createBrowser(screenWidth, screenHeight, false, false)

function webBrowserRender()
	dxDrawImage(0, 0, screenWidth, screenHeight, webBrowser, 0, 0, 0, tocolor(255,255,255,255), true)
end

addEventHandler("onClientBrowserCreated", webBrowser, 
	function()
		loadBrowserURL(webBrowser, "http://mta/local/web/index.html")
		addEventHandler("onClientRender", root, webBrowserRender)
	end
)

Thank you

Link to comment

I fixed this. In this code 3 argument replace false to true)
Before:

local webBrowser = createBrowser(screenWidth, screenHeight, false, false)

After:

local webBrowser = createBrowser(screenWidth, screenHeight, true, false)

This argument means: isLocal

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...