Jump to content

CEF Issues


ysj4

Recommended Posts

 

hello so i created a website based on javascript UI, when i load CEF in MTA, UI doesn't show up, don't know why, all files in meta.xml are typed

 

my code;

local screenWidth, screenHeight = guiGetScreenSize()

local page = "http://mta/mywebsite/index.html"
local initBrowser = guiCreateBrowser(0, 0, screenWidth, screenHeight, true, false, false)
local theBrowser = guiGetBrowser(initBrowser)

addEventHandler("onClientBrowserCreated", theBrowser, 
	function()
		loadBrowserURL(source, page)
		showCursor(true)
		
		
		
	end
)

 

my code in HTML head

<script type="text/javascript" src="js/myUI.js"></script>

 

Edited by ysj4
Link to comment
38 minutes ago, vicisdev said:

If you've written your meta.xml properly the URL should be http://mta/local/<path_to_.html>. You've missed the /local/.

Excuse me. In fact, /local/ is supposed to be the resource name. So you would do http://mta/<resource_name>/<path_to_html> if your .html is located in another resource otherwise you can still use /local/ for files located in the same resource. You should add your index.html file using the <file /> tag in  your meta.xml.

https://wiki.multitheftauto.com/wiki/Local_Scheme_Handler

Link to comment
23 hours ago, vicisdev said:

Excuse me. In fact, /local/ is supposed to be the resource name. So you would do http://mta/<resource_name>/<path_to_html> if your .html is located in another resource otherwise you can still use /local/ for files located in the same resource. You should add your index.html file using the <file /> tag in  your meta.xml.

https://wiki.multitheftauto.com/wiki/Local_Scheme_Handler

I think my files its ok, but UI still not load.

 

https://imgur.com/a/rhj4n5c

 

(dont look at auth_server type, its my fault)

Edited by ysj4
Link to comment
21 hours ago, ysj4 said:

I think my files its ok, but UI still not load.

 

https://imgur.com/a/rhj4n5c

 

(dont look at auth_server type, its my fault)

You should always check logs to see what is happening. Run your script in debug mode 3 and check the console output. You can:

1. OutputDebugString(inspect(theBrowser)) to see if it's being created properly
2. Try to load an external source (https://mtasa.com)

Link to comment
28 minutes ago, vicisdev said:

You should always check logs to see what is happening. Run your script in debug mode 3 and check the console output. You can:

1. OutputDebugString(inspect(theBrowser)) to see if it's being created properly
2. Try to load an external source (https://mtasa.com)

1. when i start my resource with my website only black background shows, its ok because i set dark background in CSS. But JS UI doesnt show's up (debug nothing shows)

2. starting with inspect output

3. page of mta doesnt shows up

 

https://imgur.com/a/dlfGLNE

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...