<?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[Different looks based on browser &#x2F; user-agent]]></title><description><![CDATA[<p dir="auto">I do realize that this is probably off-topic for the bulk of the users.</p>
<p dir="auto">I intend to run multiple mirrors off of one server instance. I will have one “complete” Magic Mirror installation (including physical mirror) but want to show the content on several other screens, not all of them mirrors!</p>
<p dir="auto">There is a very simple way of doing this and that is selecting showed content based on browser / user-agent strings. In my case I will use the Midori browser (and maybe Chromecast) for mirrors. All my other devices will use Chrome. So anything with Chrome in the user-agent will be shown a custom theme while the rest will show the “standard” theme.</p>
<p dir="auto">To accomplish this the <em>user-agent</em> needs to be saved so that the CSS can select theme based on it. I did a quick hack of <strong>index.html</strong> in the MagicMirror folder. I added the following right after the <strong></strong>-tag:</p>
<pre><code>&lt;script&gt;
  var b = document.body;
  b.setAttribute("data-useragent"), navigator.userAgent);
  b.setAttribute("data-platform"), navigator.platform);
&lt;/script&gt;
</code></pre>
<p dir="auto">I can then use <em>custom.css</em> to define a different look based on the above. In my case I wanted to have something other than a black background, i.e. a different background image. To get this I added the following in <strong>custom.css</strong>:</p>
<pre><code>body[data-useragent*="Chrome"] {
  background-image: url("background.jpg");
}
</code></pre>
<p dir="auto">This works great (I had to put the <strong>background.jpg</strong> in the <em>css</em> folder but I am sure there is another way).</p>
<p dir="auto">Now I just need to figure out how to set values in config.js to customize the modules shown. Any suggestions?</p>
]]></description><link>https://forum.magicmirror.builders/topic/865/different-looks-based-on-browser-user-agent</link><generator>RSS for Node</generator><lastBuildDate>Sun, 07 Jun 2026 11:47:28 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/865.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 24 Oct 2016 15:19:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Different looks based on browser &#x2F; user-agent on Fri, 28 Oct 2016 17:51:23 GMT]]></title><description><![CDATA[<p dir="auto">Interesting so following, as have in mind similar plans but feeding some relevant info from our Ai down to specific screens.</p>
<p dir="auto">Do keep me updated, as a server set up and API per config mirror may be the way forward.</p>
]]></description><link>https://forum.magicmirror.builders/post/7187</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/7187</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 28 Oct 2016 17:51:23 GMT</pubDate></item></channel></rss>