<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Topics tagged with feature]]></title><description><![CDATA[A list of topics that have been tagged with feature]]></description><link>https://forum.magicmirror.builders/tags/feature</link><generator>RSS for Node</generator><lastBuildDate>Thu, 13 Aug 2026 08:56:35 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/tags/feature.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 04 Feb 2017 03:10:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Check to see if file (ex. custom.css) exists before trying to load it.]]></title><description><![CDATA[I, like (I assume) many of RPi tinkerers and hackers, make code changes on my desktop or laptop and then use git to push new code to the RPi. Since MagicMirror doesn’t track css/custom.css, the mirror fails to load up if the file is missing.
I tried to come up with a PR to have the loader.js file check if the file exists before appending it to index.html. However, since this is client side JavaScript, it does not have access to the file system and can’t use the fs JavaScript module.
I then tried to use code like:
	var fileDoesNotExist= function(url) {
		var http = new XMLHttpRequest();
		http.open("HEAD", url, false);
		http.send();
		return http.status==404;
	}

to do an http request to the server for the file, but realized that it’s just as bad as the actual http request that tries to load the file and will result in the same errors.
So, I’m posting this here in case anyone has ideas and can help me with creating a PR to solve this problem. It’s not really a bug and not really a feature. Just an error check that’s missing.
Thanks.
]]></description><link>https://forum.magicmirror.builders/topic/1646/check-to-see-if-file-ex-custom-css-exists-before-trying-to-load-it</link><guid isPermaLink="true">https://forum.magicmirror.builders/topic/1646/check-to-see-if-file-ex-custom-css-exists-before-trying-to-load-it</guid><dc:creator><![CDATA[stanchan]]></dc:creator><pubDate>Sat, 04 Feb 2017 03:10:37 GMT</pubDate></item></channel></rss>