How do I load exported html5 game on browser w/o upload

Get help using Construct 2

Post » Sat Jun 24, 2017 8:17 am

I'm just wondering if it's possible to load the exported html5 game on the browser without uploading it online? Any trick you can share? Thanks in advance.
B
46
S
14
G
20
Posts: 86
Reputation: 12,886

Post » Sat Jun 24, 2017 11:11 am

Yeah, just start the index.html file, and if it gives you warning click okay.

If you know html you can also disable the warning, open the index file with notepad++ or some other editing program add comments to the code where it checks if game is running or server or not.
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,357

Post » Sat Jun 24, 2017 9:53 pm

imhotep22 wrote:Yeah, just start the index.html file, and if it gives you warning click okay.

If you know html you can also disable the warning, open the index file with notepad++ or some other editing program add comments to the code where it checks if game is running or server or not.


Thanks for the reply brotha, will check this out if it work. :D :D :D
B
46
S
14
G
20
Posts: 86
Reputation: 12,886

Post » Sun Jun 25, 2017 3:05 am

@imhotep22

In the index.html file, I didn't see any disable to make it view able offline, so I tried to remove this code, but only firefox is able to load it offline and chrome shows only a black screen. I don't know if I'm doing it right, I'm not an expert with advanced html.

Code: Select all
<script>
   // Issue a warning if trying to preview an exported project on disk.
   (function(){
      // Check for running exported on file protocol
      if (window.location.protocol.substr(0, 4) === "file")
      {
         alert("Exported games won't work until you upload them. (When running on the file:/// protocol, browsers block many features from working for security reasons.)");
      }
   })();
   </script>
B
46
S
14
G
20
Posts: 86
Reputation: 12,886

Post » Sun Jun 25, 2017 5:16 am

This is why we have the nwjs exporter.
Image ImageImage
B
168
S
50
G
163
Posts: 8,224
Reputation: 105,067

Post » Sun Jun 25, 2017 11:20 am

(function(){
      // Check for running exported on file protocol
      if (window.location.protocol.substr(0, 4) === "file")
      {
         alert("Exported games won't work until you upload them. (When running on the file:/// protocol, browsers block many features from working for security reasons.)");
      }
   })();

Remove that function to remove the warning thing, and yes probably the game wont work on chrome until exported, but it will work or any other browser like mozila or edge.
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,357

Post » Sun Jun 25, 2017 11:54 am

Why not just preview the game in Construct? That lets you play it without uploading anything :P

That error message in exported games is there for a reason, deleting it won't magically fix the game. Generally you can't run games from the file:/// protocol because the browser will block all sub-resource requests (e.g. images, sounds etc).
Scirra Founder
B
387
S
230
G
87
Posts: 24,249
Reputation: 192,240

Post » Sun Jun 25, 2017 1:13 pm

Ashley wrote:Why not just preview the game in Construct? That lets you play it without uploading anything :P

That error message in exported games is there for a reason, deleting it won't magically fix the game. Generally you can't run games from the file:/// protocol because the browser will block all sub-resource requests (e.g. images, sounds etc).


@Ashley

Thankfully you noticed my post, I will take this opportunity to address this issue about monetizing construct 2 apps. I'm figuring out something to make admob ad work on my game, lately nothing seems to work anymore from any Cordova admob plugins, intel XDK, Cocoon and Phonegap. It seems that it is impossible now to monetize a game created from Construct 2. I hope you guys up there would provide us some sort of a really working regularly updated guide on how to monetize games created from Construct 2.
B
46
S
14
G
20
Posts: 86
Reputation: 12,886


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 11 guests