Hacking Google Chrome’s T-Rex Game!

Google Chrome, like all other Google products, has an interesting easter egg — the dino game! It appears as an 8-bit dinosaur on the no internet connection page. As soon as you’ll hit the spacebar or just click on it, it starts running!

Maria Nicole
May 31 · 3 min read

But, do you know, you can also HACK IT!

With the hacks, you can alter the speed of the game and even make your dinosaur immortal (you won't die even if you get hit).

Excited for it? Let’s do it then!

Here’s How to Hack Dino Game (2 Methods)

First of all, disconnect your internet to open the “No Internet” page. For that, You can either turn off your wifi or simply type chrome://dino in the address bar.

The screen will look like this.

Now, right click on the screen anywhere and select Inspect from the submenu. Or, you can use the hotkey combination Ctrl+Shift+I for the same.

This will open the source code version of the same adjacent to the original webpage.

In this section, Go to the Console tab.

Here you will see a command line interface where you can enter lines of code in order to ‘hack’ the dino game and make it run according to you.

You can hack the following features using the respective code provided below.

1. Increasing the Speed

If you think the t-rex running at the normal speed is not so challenging, then this hack is for you!

There is this secret method using which you can increase the speed of the little dino make the game bit more difficult and interesting.

All you have to do is put the following piece of code in the Console tab.

Runner.instance_.setSpeed(1000)

After pasting the code in the console tab, hit Enter.

And Voila! Your t-rex will get a speed boost in no time.

In case, you still want a little more insanity, just increase the number inside the brackets and see the magic.

Don’t forget to hit enter after each command.

2. Becoming Immortal

Another hack for the chrome dino game is the immortality or unlimited life hack. I personally call it cheating rather than a hack for obvious reasons but still, I am sharing it with you.

If you want to win from your cousin or your office colleague in the Google Dino game, I have a little piece of code that can make your t-rex immortal.

To become immortal, just copy and paste the code below into the console tab and hit enter.

var original = Runner.prototype.gameOver

The above line stores the original gameOver function from the game’s code into a static variable ‘original’ (this will help in restoring the functionality).

Now, paste the following code in the console tab and hit enter.

Runner.prototype.gameOver = function(){}

This code will replace the original gameOver function with an empty function. This is what makes you t-rex immortal.

If you’re done with unlimited life and want to switch back to normal, just paste the following line in the console tab and hit enter.

Runner.prototype.gameOver = original

By entering this code, we are actually restoring the gameOver function by transferring the original function that we saved in the variable “original” to its default state once again.

With immortality turned, the game should work something like the image below.

That’s all friends! These were the two easy and simple ways to hack the Google Dino game. It is fun to twist things around make them into some even more interesting for the end user.

By hacking google dino game, I nowhere want to spread any malicious intentions towards Google Chrome or its users.

Disclaimer: This hacking tutorial is for educational purpose only.

HackerNoon.com

Maria Nicole

Written by

Loves to write about Books, Technology and Lifestyle for the millennial audience.

HackerNoon.com

how hackers start their afternoons.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade