A simple Chrome warning

Posted by (twitter: @LiamLimeGames)
April 19th, 2015 9:33 pm

Not the prettiest thing in the world, but it’s a thing!

Copy-paste the code below into the HTML page Unity outputs when you build. This will only show the warning to users of chrome version 42 or later. (Web developers will cringe at the code, but hey… expecting extra effort right after 48 hours of crunch time 😀 )

The code:

<script type=’text/javascript’>if((navigator.userAgent.toLowerCase().indexOf(‘chrome’) > -1) && (parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) >= 42)){document.write(“<div id=’ChromeAlert’ style=’margin-left: auto; margin-right: auto; max-width: 800px; background-color: #ffdddd; display: block;’><table cellspacing=’0′ cellpadding=’5′><tr style=’background-color: #ffcccc;’><td colspan=’2′><b>Attention users of Chrome!</b> <a href=’#’ onclick=’var a = document.getElementById(\”ChromeAlert\”); a.style.display = \”none\”; return false;’>close</a></td></tr><tr><td><img src=’http://upload.wikimedia.org/wikipedia/commons/8/87/Google_Chrome_icon_(2011).png’ style=’width:64px;’></td><td><b>Users of Chrome:</b> As of version 42 (released April 14 2015), the Unity web player <b>DOES NOT WORK</b>. While this will probably be fixed soon, it probably won’t be fixed until rating ends. Please consider playing this game with another browser – it works with Internet Explorer and <a href=’https://www.mozilla.org/en-GB/firefox/new/’>Firefox</a>.</td></tr></table></div>”);}</script>


6 Responses to “A simple Chrome warning”

  1. Deity says:

    There is already a warning message given by Ludum at the top of the game pages and it also mentions a workaround — (enabling nsapi).

    This probably isn’t something that will be ‘fixed’ since it’s an intentional disabling of the plugin API by Google.

  2. Liam :D says:

    Not all traffic comes from ludumdare.com, and you should know that there can never be enough warnings to guarantee people have seen them. People who saw the warnings on ludumdare.com will know not to even get to this one, but I guarantee there will be many who will ignore all warnings and just end up downvoting games because “they don’t work”.

    Also this will be fixed by Unity, not Google.

    • PoV says:

      It might never get fixed actually. General consensus among those in browser land is that everything is moving to pure HTML5 (and WebGL). Unity has a WebGL export, but it isn’t perfect. When it gets there though, there will be little reason to use the plugin. Maybe for legacy browsers (Internet Explorer), but that’s it.

      • Liam :D says:

        While that will eventually be the case, I don’t think Unity can afford to not have a web presence on Chrome between now and when their WebGL export is ready. While I don’t know how vital NPAPI is to Unity, I am willing to make an educated guess and say… not that much.

      • Deity says:

        What PoV said. This is *not* a bug in Unity or Google.

        The new Chrome intentionally disables all external plugins, not just Unity — it also disables Java, Silverlight and a bunch of other plugins.

        Your warning message is actually misleading since it points the problem at Unity when its an intentional (but annoying) move by Google that affects every plugin.

        • Liam :D says:

          To the end user, the background story is irrelevant. Google disabled the 20 year old API and it is now up to plugin developers to adapt. Whose ‘fault’ it is is irrelevant.

          I can’t take either ‘side’ since Google should have waited for at least Java to adapt, but all plugin developers had 2 years head notice with an alternative available: PPAPI – the plugin developers should have adapted ahead of time.

Leave a Reply

You must be logged in to post a comment.

[cache: storing page]