Jump to content

How to close a browser?


Recommended Posts

Hi

How can I close a created browser after hiding contained window?

the issue is that a video is playing in browser and when user closes the window, video keeps playing.

local screenWidth, screenHeight = guiGetScreenSize()
local window = guiCreateWindow( 0, 0, screenWidth, screenHeight, "Web Browser", false )
local browser = guiCreateBrowser(10, 10, screenWidth-10, screenHeight-10, true, false, false, window)
local the_browser = guiGetBrowser(browser)
--outputConsole("Creating Browser")

addEventHandler("onClientBrowserCreated", the_browser,
    function()
        res = loadBrowserURL(source, "http://mta/local/web/page.html")
    end
  )

 

Link to comment
  • Scripting Moderators

Hi, welcome to the forums!

I've moved your thread to the Scripting section as this is the right place to get assistance with scripting-related problems.

  • Like 1
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...