Skip to content
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

Configurable error / no internet connection handling #28

Open
javirst opened this issue May 11, 2021 · 2 comments
Open

Configurable error / no internet connection handling #28

javirst opened this issue May 11, 2021 · 2 comments
Labels
enhancement New feature or request rpatchur

Comments

@javirst
Copy link
Contributor

javirst commented May 11, 2021

I think patcher should be able to handle error when unable to connect to targeted url.

Either by

  1. Default Error HTML page in patcher directory
  2. Caching the last page
@L1nkZ
Copy link
Owner

L1nkZ commented May 16, 2021

Hi.
Yes that's right, not being able to display anything when lacking connectivity is not the best experience I agree.
Caching would be great to have at least, and yes, maybe having a 404-style page to display in these case would be better.

@L1nkZ L1nkZ added enhancement New feature or request rpatchur labels May 16, 2021
@javirst
Copy link
Contributor Author

javirst commented May 18, 2021

Oh yeah, another alternative solution is load the page using AJAX.
First make an HTML for the loader like this

Note: this is just a demonstration, We need to parse body tag, window.eval the scripts tags and load src scripts to load in document.

<body>
	Loading Patcher..
	<script>
		var xmlHttp = new XMLHttpRequest();
		xmlHttp.onreadystatechange = function () {
			if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
				document.body.innerHTML = xmlHttp.responseText;
			}
		}
		xmlHttp.open("GET", "http://yourserver.com/patcher.html", true);
		xmlHttp.send()
	</script>
</body>

Also some modification will be needed if the HTML were outside the executable.

Note: In general storing the assets outside executable are greater security risk

web:
  # index_url: file://C:/randomFiles/OhNoWhatIsThis/myRO/loader.html
  index_url: {current_dir}/loader.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request rpatchur
Projects
None yet
Development

No branches or pull requests

2 participants