I need help opening the in-game CEF browser with a command. Can anyone give me some help?
Here's what I've tried, but it does not work.
--In order to render the browser on the full screen, we need to know the dimensions.
local screenWidth, screenHeight = guiGetScreenSize()
--Let's create a new browser in remote mode.
local window = guiCreateWindow(0, 0, screenWidth, screenHeight, "Webbrowser", false)
local browser = guiCreateBrowser(0, 0, 800, 600, false, false, false, window)
-- The event onClientBrowserCreated will be triggered, after the browser has been initialized.
-- After this event has been triggered, we will be able to load our URL
local theBrowser = guiGetBrowser(browser) -- Get the browser element from gui-browser
addEventHandler("onClientBrowserCreated", theBrowser,
function LoadBrowser()
-- After the browser has been initialized, we can load [url=https://www.youtube.com]www.youtube.com[/url]
loadBrowserURL(source, "https://www.youtube.com")
end
)
addCommandHandler ("browser", LoadBrowser)