Browser 'Close' not working in Firefox

  • Problem Description

    The browser object cannot close the browser window in Firefox. It works instantly in chrome, works with a warning in IE, but nothing happens in Firefox.

    Attach a Capx

    Description of Capx

    Press the button, and the window should close.

    Steps to Reproduce Bug

    • Add the browser object to a new project.
    • Add a button with On Click -> Browser: Close
    • Run the project and click the button.

    Observed Result


    Expected Result

    The browser window instantly closes.

    Affected Browsers

    • Chrome: NO
    • FireFox: YES - 59.0.2 (64-bit)
    • Internet Explorer: NO

    Operating System and Service Pack

    Win 7 SP2 64-Bit

    Construct 2 Version ID

    r256 64-bit

  • The .capx link is 404, so closing.

    Further, whether or not JavaScript has permission to close the browser window depends on the browser and circumstances. Usually it can only close popup windows that were also opened by script. Otherwise browsers may block the close call in order to avoid web pages annoying the user by self-closing tabs or windows when they don't want them to.

  • Hey, thanks for replying. A couple things come to mind that make me question whether this should be closed or not.

    If this is being closed because the capx link has expired, I can repost it. My fault; I didn't realize those links expired so soon. (You don't really need the capx; it can be done in any capx by adding a button with browser -> close, and running it in firefox.)

    But more importantly, how do you make a browser game "quit" function without calling Browser -> Close? Or put another way, why is Browser -> Close an option in the Browser plug-in if it's inconsistent in different browsers? If the point of the feature is to close the window, but it doesn't always work, what's the valid use case for it?

    I may have this wrong. But it seems strange to have a feature that depends on the browser; naturally people aren't developing just for Chrome with HTML5 games.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It's there in case you are using a popup window, and it works on other platforms like Android where it does make sense to quit. You can't really "quit" a browser tab though, the user is in control of that.

  • Ah ok, understood. The idea was to use it in fullscreen game; having a quit option that closed the browser was more elegant than using Cancel Fullscreen, and then letting the user do it.

    Thanks for the reply.

  • Ashley, it is no longer working on Android. At least weeks ago everything worked fine. Now all games don't close and fullscreen doesn't work either.

  • This used to work for me in Chrome but as above has stopped working on all my apps :(

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)