Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
982
Reaction score
478
First Language
PT-BR
Primarily Uses
RM2k3
This error happens because you try to play a game in the web browser directly when running INDEX.HTML.

Modern browsers have a security system that prevents local files from trying to capture information from other sites via AJAX, but you can disable this security (CROSS-ORIGIN).

The tutorial is for the following browsers:
  • Google Chrome
  • Opera (Chromium)
  • Mozilla Firefox

Google Chrome/Opera:
To disable use the following command line:
--allow-file-access-from-files

  • Create a browser shortcut on the Desktop.
  • Right-click on it and select Properties.
  • In the "Destination" box enter the parameter after the second quotation mark with a space and save.
Close any windows of the chosen Chromium that were run before starting.

Mozilla Firefox:
In the browser address bar enter the following command:
about:config

Press [I'll be careful, I promise!] button.Do not change anything on this screen, just what was shown in the tutorial.

In the search field type:
security.fileuri.strict_origin_policy

Double click this item, it will change from "true" to "false".This is done, but you may need to restart the browser.
 
Last edited:

NoPiessadface

Veteran
Veteran
Joined
Feb 7, 2019
Messages
141
Reaction score
44
First Language
english
Primarily Uses
RMVXA
still doesn't work on chorme
 

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
982
Reaction score
478
First Language
PT-BR
Primarily Uses
RM2k3
I'm using version 87 of Chrome, and it's working.
You must have written the command line without a space.
 

zzmmorgan

I've used punchcards
Veteran
Joined
Jul 10, 2020
Messages
181
Reaction score
294
First Language
English
Primarily Uses
RMMZ
I just installed IIS and tested from there. For more serious testing I have access to a friend's VPS :)

I honestly don't recall which method I used but most of them should be fairly easy to follow and then it's running off an actual website ( even if it's just your computer) so the browsers won't care.

I wouldn't recommend opening up your computer to be a full-blown webserver to the internet though unless you want to deal with additional security issues. Just keep it local. But overall it's a fairly good way to be able to test your HTML5 games without trying fake out your browser.
 

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
982
Reaction score
478
First Language
PT-BR
Primarily Uses
RM2k3
In the Rpg Maker manual there is a tutorial teaching how to enable the local server in Windows.
(RPG Maker MV> Documentation> Local server configuration)
  1. MacOS
  2. Linux

But in this case, I showed you how to open index.html directly from Explorer, as a faster alternative.
 
Last edited:

ray_stride07

Veteran
Veteran
Joined
Feb 28, 2022
Messages
56
Reaction score
10
First Language
Indonesia
Primarily Uses
RMMV
This error happens because you try to play a game in the web browser directly when running INDEX.HTML.

Modern browsers have a security system that prevents local files from trying to capture information from other sites via AJAX, but you can disable this security (CROSS-ORIGIN).

The tutorial is for the following browsers:
  • Google Chrome
  • Opera (Chromium)
  • Mozilla Firefox

Google Chrome/Opera:
To disable use the following command line:
--allow-file-access-from-files

  • Create a browser shortcut on the Desktop.
  • Right-click on it and select Properties.
  • In the "Destination" box enter the parameter after the second quotation mark with a space and save.
Close any windows of the chosen Chromium that were run before starting.

Mozilla Firefox:
In the browser address bar enter the following command:
about:config

Press [I'll be careful, I promise!] button.Do not change anything on this screen, just what was shown in the tutorial.

In the search field type:
security.fileuri.strict_origin_policy

Double click this item, it will change from "true" to "false".This is done, but you may need to restart the browser.
I am getting this error when running it in android. How to fix this ?
 

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
982
Reaction score
478
First Language
PT-BR
Primarily Uses
RM2k3
1 - Sorry for the @ray_stride07 question, but why did you replicate the entire tutorial in your message to just ask one question?
2 - As well on Android, there is no information, I can't help.
3 - I don't know what you've done or how you did it, I get pretty frustrated that something so obvious needs to be explained that I can't guess.
4 - I also assume that if I manage to solve it, I probably won't get a "reaction" in the tutorial and not even a thank you as is already common here by other members who post similarly to you.
5 - I really hope I can help you in the next few days...

I don't understand, what do you mean by running on Android? There is no clear information of your problem, I can't help if you are so vague.

Brief explanation: Android is an operating system, just like Windows, Linux and macOS.

The tutorial explains how to run the game in browsers bypassing security in order to facilitate testing in browsers.
 
Last edited:

smallpotato

Warper
Member
Joined
Sep 24, 2022
Messages
2
Reaction score
0
First Language
english
Primarily Uses
RMMV
Hi, I'm also getting the same error in Android studio, but I'll elaborate a bit more than that other guy.

I'm working on making an app for my game and the easiest way to bridge the gap between the Java in android studio and the Javascript in RPG maker is using HTML to create a webview of the game to be displayed through android studio. I've done this and I'm guessing from your previous post that it's acting like a browser and limiting the Javascript from accessing the files. I'm wondering if there's a fix I can code in directly so that I can create a complete and working app for my game.

If you can help me with this one I'll sing your praises and give you a special thanks credit in my game.
 

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
982
Reaction score
478
First Language
PT-BR
Primarily Uses
RM2k3
Last edited:

smallpotato

Warper
Member
Joined
Sep 24, 2022
Messages
2
Reaction score
0
First Language
english
Primarily Uses
RMMV
You need to search about WebView in Android Studio, maybe this will solve your problem:
That was it! I don't think I'd have found that very easily. I was mostly searching "WebView ajax" which wasn't giving me much. Many thanks, I'll put you in as Dev with Coffee unless otherwise requested.
 

Latest Threads

Latest Posts

Latest Profile Posts

ScreenShot_10_5_2022_4_44_8.png
Mad O' Malley... a stick figure that's afraid of it's existence being erased. so they always start battle in an anxious state.
Before, I was drawing all the sprite work, super big and shrinking it down. Which was really time consuming if thing's changed. So instead I'm drawing the characters sketch, and then remaking it with pixel art instead.
Why are job interviews so terrifying. :kaodes:

Forum statistics

Threads
125,797
Messages
1,173,629
Members
164,963
Latest member
ervll
Top