Jump to content

Crear Browser


Narutimmy

Recommended Posts

hola tengo la duda, como creo un browser? vi este script en el foto buscando en teria funciona pero ami no me anda, una ayuda?

var = false 
local screenWidth, screenHeight = guiGetScreenSize() 
browser_ = createBrowser(screenWidth, screenHeight, false, false) 
  
function webBrowserRender() 
    if isElement(browser_) then 
    dxDrawImage(0.01, 0.04, 0.98, 0.93, browser_, 0, 0, 0, tocolor(255,255,255,255), true) 
    end 
end 
  
  
function loadBrowser_(bool) 
    if bool == true then 
    showCursor(true) 
    loadBrowserURL(browser_, "https://www.youtube.com/watch?v=ohBQ59OXnYM") 
    focusBrowser(browser_) 
    addEventHandler("onClientRender", root, webBrowserRender) 
    elseif bool == false then 
    destroyElement(browser_) 
    removeEventHandler("onClientRender", root, webBrowserRender) 
    showCursor(false) 
    end 
end 
  
  
bindKey("F1","down", 
function() 
    if var == true then 
    var = false 
    loadBrowser_(false) 
    elseif var == false then 
    var = true 
         
        loadBrowser_(true) 
         
    end 
end) 
  

Link to comment
hola tengo la duda, como creo un browser? vi este script en el foto buscando en teria funciona pero ami no me anda, una ayuda?
var = false 
local screenWidth, screenHeight = guiGetScreenSize() 
browser_ = createBrowser(screenWidth, screenHeight, false, false) 
  
function webBrowserRender() 
    if isElement(browser_) then 
    dxDrawImage(0.01, 0.04, 0.98, 0.93, browser_, 0, 0, 0, tocolor(255,255,255,255), true) 
    end 
end 
  
  
function loadBrowser_(bool) 
    if bool == true then 
    showCursor(true) 
    loadBrowserURL(browser_, "https://www.youtube.com/watch?v=ohBQ59OXnYM") 
    focusBrowser(browser_) 
    addEventHandler("onClientRender", root, webBrowserRender) 
    elseif bool == false then 
    destroyElement(browser_) 
    removeEventHandler("onClientRender", root, webBrowserRender) 
    showCursor(false) 
    end 
end 
  
  
bindKey("F1","down", 
function() 
    if var == true then 
    var = false 
    loadBrowser_(false) 
    elseif var == false then 
    var = true 
         
        loadBrowser_(true) 
         
    end 
end) 
  

Podrías usar el que viene en la carpeta de resources (webbrowser) , modifica le el bind con el que se abre y listo.

Link to comment
var = false 
local screenWidth, screenHeight = guiGetScreenSize() 
browser_ = createBrowser(screenWidth, screenHeight, false, false) 
  
function webBrowserRender() 
    if isElement(browser_) then 
    dxDrawImage(screenWidth*0.01, screenHeight*0.04, screenWidth*0.98, screenHeight*0.93, browser_, 0, 0, 0, tocolor(255,255,255,255), true) 
    end 
end 
  
  
function loadBrowser_(bool) 
    if bool == true then 
    showCursor(true) 
    loadBrowserURL(browser_, "https://www.youtube.com/watch?v=ohBQ59OXnYM") 
    focusBrowser(browser_) 
    addEventHandler("onClientRender", root, webBrowserRender) 
    elseif bool == false then 
    destroyElement(browser_) 
    removeEventHandler("onClientRender", root, webBrowserRender) 
    showCursor(false) 
    end 
end 
  
  
bindKey("F1","down", 
function() 
    if var == true then 
    var = false 
    loadBrowser_(false) 
    elseif var == false then 
    var = true 
        
        loadBrowser_(true) 
        
    end 
end) 

Link to comment

El problema es que por ejemplo googlew si carga, pero mi web no,

requestBrowserDomains{"http://thezombiworld.com,http://64.94.238.182"} 
  
  
  
--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.02, 0.01, 0.95, 0.96, "TheZombiWorld", true) 
local browser = guiCreateBrowser(0, 0,  800, 600, false, false, false, window) 
guiSetVisible(window,false) 
  
-- 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() 
        -- After the browser has been initialized, we can load [url=http://www.youtube.com]http://www.youtube.com[/url] 
         
        loadBrowserURL(source, "http://thezombiworld.com") 
    end 
) 
  
function open() 
guiSetVisible ( window, not guiGetVisible ( window ) ) 
showCursor ( guiGetVisible ( window ) ) 
end 
addCommandHandler("browser",open) 

Link to comment
  • Recently Browsing   0 members

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