Skip to content

Delete Utils.canReadGameFiles method #187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions js/rpg_core/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,27 +99,6 @@ Utils.isAndroidChrome = function() {
return !!(agent.match(/Android/) && agent.match(/Chrome/));
};

/**
* Checks whether the browser can read files in the game folder.
*
* @static
* @method canReadGameFiles
* @return {Boolean} True if the browser can read files in the game folder
*/
Utils.canReadGameFiles = function() {
var scripts = document.getElementsByTagName('script');
var lastScript = scripts[scripts.length - 1];
var xhr = new XMLHttpRequest();
try {
xhr.open('GET', lastScript.src);
xhr.overrideMimeType('text/javascript');
xhr.send();
return true;
} catch (e) {
return false;
}
};

/**
* Makes a CSS color string from RGB values.
*
Expand Down
7 changes: 0 additions & 7 deletions js/rpg_managers/SceneManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ SceneManager.run = function(sceneClass) {
SceneManager.initialize = function() {
this.initProgressWatcher();
this.initGraphics();
this.checkFileAccess();
this.initAudio();
this.initInput();
this.initNwjs();
Expand Down Expand Up @@ -91,12 +90,6 @@ SceneManager.checkWebGL = function() {
}
};

SceneManager.checkFileAccess = function() {
if (!Utils.canReadGameFiles()) {
throw new Error('Your browser does not allow to read local files.');
}
};

SceneManager.initAudio = function() {
var noAudio = Utils.isOptionValid('noaudio');
if (!WebAudio.initialize(noAudio) && !noAudio) {
Expand Down