Only Google Chrome?

0 favourites
  • 11 posts
From the Asset Store
Google Analytics 4 Plugin for Construct 3 enables metrics and analytics for your games easily.
  • How to make so that game it was started only in Google Chrome?

    I did so:

    <img src="" border="0" />

    But it doesn't work in Linux, as FPS <60 in Chrome.

    Game Angry Birds example in Opera:

    <img src="" border="0" />

  • I would do it with a bit of javascript and css.

    This is the javascript part, then you could make a not chrome div in the html and show it.

    var userAgent = navigator.userAgent.toLowerCase();

    $ = /chrome/.test(navigator.userAgent.toLowerCase());

    // Is this a version of Chrome?



    } else {



  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks

  • It is impossible to me. It is possible to set an example?

  • This si the index.html that construct generates, open it and change everything to this:

    <!DOCTYPE html>

    <html manifest="offline.appcache">


        <meta charset="UTF-8" />


         <!-- This ensures the canvas works on IE9+. Don't remove it! -->

         <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=IE8" />



         <!-- Note: running this exported project from disk may not work exactly like preview, since browsers block some features on the file:// protocol. Once you've uploaded it to a server, it should work OK. -->


        <!-- This outlines the canvas with a black border. -->

         <style type="text/css">

              canvas { border: 1px solid black; }




         <div id="fb-root"></div>

         <div style="text-align: center;" id="canvas-container">

            <!-- The canvas the project will render to. If you change its ID, don't forget to change the

            ID the runtime looks for in the jQuery ready event (above). -->

              <canvas id="c2canvas" width="640" height="480" oncontextmenu="return false;" onselectstart="return false;">

                <!-- This text is displayed if the visitor's browser does not support HTML5.

                You can change it, but it is a good idea to link to a description of a browser

                and provide some links to download some popular HTML5-compatible browsers. -->

                   Your browser does not appear to support HTML5. Try upgrading your browser to the latest version. <a href="">What is a browser?</a>

                   <br/><br/><a href="">Microsoft Internet Explorer</a><br/>

                   <a href="">Mozilla Firefox</a><br/>

                   <a href="">Google Chrome</a><br/>

                   <a href="">Apple Safari</a><br/>

                   <a href="">Google Chrome Frame for Internet Explorer</a><br/>




         <div id="no-chrome" style="display:none">



         <!-- Pages load faster with scripts at the bottom -->


         <!-- Construct 2 exported games require jQuery. To save bandwidth, by default

         this is set to grab it off the Google content delivery network (CDN). Fall back to local if not available. -->

         <script src=""></script>

         <script>window.jQuery || document.write("<script src='jquery-1.6.3.min.js'>\x3C/script>")</script>


        <!-- The runtime script. You can rename it, but don't forget to rename the reference here as well.

        This file will have been minified and obfuscated if you enabled "Minify script" during export. -->

         <script src="c2runtime.js"></script>


            // Start the Construct 2 project running on window load.

            jQuery(document).ready(function ()


                   var userAgent = navigator.userAgent.toLowerCase();

                   $ = /chrome/.test(navigator.userAgent.toLowerCase());


                        // Create new runtime using the c2canvas


                      //INITIALIZE CONSTRUCT

                   } else {








  • Yes it works. Thanks.

    And where to add the reference to a picture about the prevention?

  • Put your html here:

    <div id="no-chrome" style="display:none">



  • I am grateful to you for the help. Thanks.

  • The HTML content shown between the <canvas> and </canvas> tags in the exported page is shown if the browser doesn't support canvas. You should just use that, it's much easier!

  • why only chrome? I use only Opera & Firefox...

  • In <canvas> the content is displayed when the browser doesn't support HTML5, but we a script block opening <c2canvas> from for it it empty. How in <canvas> to insert the image?

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