Good morning, I apologize in advance for my English. When you start up the browser, It turns a normally if the page is enter one of the domains , for example youtube but the problem appears when you upload the html file that is located in the resource.
Please to code:
Meta.xml:
<meta>
<script src="Show.lua" type="client" />
<html src="index.html" default="true" />
<file src="index.html" />
<file src="jquery-2.1.4.min.js" />
</meta>
Clientside:
local screenWidth, screenHeight = guiGetScreenSize()
local window = guiCreateWindow(0, 0, screenWidth, screenHeight, "Webbrowser", false)
local sx,sy = guiGetSize( window, false )
local browser = guiCreateBrowser(0, 0, sx/2, sy/2, false, false, false, window)
local theBrowser = guiGetBrowser(browser)
addEventHandler("onClientBrowserCreated", theBrowser,
function()
loadBrowserURL(theBrowser, "https://www.youtube.com/?hl=es&gl=US")
end
)
local browser_2 = guiCreateBrowser(sx/2, sy/2, sx/2, sy/2, false, false, false, window)
local theBrowser_2 = guiGetBrowser(browser_2)
addEventHandler("onClientBrowserCreated", theBrowser_2,
function()
loadBrowserURL(theBrowser_2, "http://mta/html/index.html")
end
)
HTML:
<html>
<body>
This resource is called <* httpWrite( getResourceName(getThisResource()) ) *>
</body>
<html>