Recent Posts

How to add Chrome Browser's Tirex Game to Electron Browser?


In the previous tutorial we added the ability of storing and viewing bookmarks in the Electron Browser. If you missed that tutorial, I do recommend you to read it here.

In this tutorial we are going to add a cool feature. You all know the Tirex dinosaur game that shows up in the Google Chrome browser when you are offline. Well we going to add that in to our Electron Browser. First I would like to thank to The Code Post for sharing the source code of this cool offline game.

Go to "electronbrowser.js" and add the following variable in the "//Initializing the components" section


Then click below the comment "//Load Tirex game when failed to load" to add the following code;


Go to "//Event Listeners" and this code.


Now we need the "Tirex Dinosaur Game". Create a HTML file in the "Starter" folder and name it "tirex.html" and add the following code.


Great! Now it's time to try this. Make sure you are offline before you run the application at this moment. Well, since you are offline now, you will be redirected to the "Tirex Dinosaur Game". Press space and start playing the "Tirex Dinosaur Game" as same as on Chrome browser.



Next Tutorial: Adding DevTools to Electron Browser
How to add Chrome Browser's Tirex Game to Electron Browser? 5 of 5

Post a Comment

0 Comments