<?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[MMM-iframe problem plz help me]]></title><description><![CDATA[<p dir="auto">I’d like to launch the web using myframe, but there’s no response.<br />
Please help me.This is the code I wrote.</p>
<p dir="auto"><strong>~/MagicMirror/modules/default/MMM-iFrame/MMM-iFrame .js</strong></p>
<pre><code>/* global Module */

/* Magic Mirror
 * Module: iFrame
 *
 * By Ben Williams http://desertblade.com
 * MIT Licensed.
 */

Module.register("MMM-iFrame",{
                // Default module config.
                defaults: {
                                height:"100px",
                                width:"100%",
                                updateInterval: 0.5 * 60 * 1000,
                                url: "http://www.naver.com",
                                scrolling: "no"
                },

        start: function () {
                self = this;
                var count = 0;
                if (this.config.url.length &gt; 0 ) {
                      setInterval( function () {
                         self.updateDom(1000);
                         console.log('update' + count++)
                         }, this.config.updateInterval);
                }
        },
  getRandomInt: function (min, max) {
    return Math.floor(Math.random() * (max - min)) + min;
  },
resume: function() {
   console.log("Resuming");
   return this.getDom();
},

        // Override dom generator.
        getDom: function() {
                var iframe = document.createElement("IFRAME");
                iframe.style = "border:0"
                iframe.width = this.config.width;
                iframe.height = this.config.height;
                iframe.scrolling = this.config.scrolling;
                var url_index = 0;
         //       console.log("currentURL:" + this.currentURL);
                var repeat = true;
                while(repeat) {
                    url_index = this.getRandomInt(0,this.config.url.length);
                    futureURL = this.config.url[url_index];
                    console.log("URL_length:" + this.config.url.length + " " + "URL_index:" + url_index + " " + "url:" + futureURL);
           //         if( futureURL == currentURL) {
                        iframe.src = futureURL;
             //           currentURL = futureURL;
                        repeat = false;
               //     }
                }
                return iframe;
              }
});
</code></pre>
<p dir="auto"><strong>~/MagicMirror/config/config.js</strong></p>
<pre><code>                        }
                },

{
                        module: "newsfeed",
                        position: "bottom_bar",
                        config: {
                                feeds: [
                                        {
                                                title: "New York Times",
                                                url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml"
                                        }
                                ],
                                showSourceTitle: true,
                                showPublishDate: true
                        }
                },
        {
                module: "MMM-iFrame",
                position: "middle_center",      // This can be any of the regions.
                config: {
                        // See 'Configuration options' for more information.
                                url: "http://www.naver.com",  // as many URLs you want or you can just ["ENTER IN URL"] if single URL.
                                updateInterval: 0.5 * 60 * 1000, // rotate URLs every 30 seconds
                                width: "100%", // Optional. Default: 100%
                                height: "100px" //Optional. Default: 100px
                        }

        },
        ]

};

/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {module.exports = config;}
</code></pre>
]]></description><link>https://forum.magicmirror.builders/topic/8852/mmm-iframe-problem-plz-help-me</link><generator>RSS for Node</generator><lastBuildDate>Thu, 21 May 2026 04:10:57 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/8852.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 03 Oct 2018 10:27:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to MMM-iframe problem plz help me on Thu, 04 Oct 2018 11:35:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/wltn" aria-label="Profile: wltn">@<bdi>wltn</bdi></a><br />
There are so many iFrame modules. Which one did you use? It seemed this(<a href="https://github.com/alberttwong/MMM-iFrame" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/alberttwong/MMM-iFrame</a>) but your code is not the same with that.<br />
First, why did you modify the source of MMM-iFrame, especially <code>defaults</code>?<br />
Second, Since you modified it, the code couldn’t work as its purpose.<br />
So…</p>
<ol>
<li>Back to the original source.</li>
<li>Use Configuration like this.</li>
</ol>
<pre><code>config: {
  url: ["http://www.naver.com"], 
}
</code></pre>
<p dir="auto">(코드 고치셨네요. 오리지널 소스로 돌리시고, config.js에서 윗부분처럼 쓰시기만 하시면 됩니다. 원작자가 배열로 받게 만든 변수를 코드 고치시고 config에서 잘못 지정하시는 바람에 문자열싱글변수가 되어버렸는데 소스 중에 배열처리하는 부분에서 배열이 아니다보니 정상동작을 안하는 듯 하네요.)</p>
]]></description><link>https://forum.magicmirror.builders/post/44977</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/44977</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Thu, 04 Oct 2018 11:35:56 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-iframe problem plz help me on Thu, 04 Oct 2018 03:43:53 GMT]]></title><description><![CDATA[<p dir="auto">@sean Thank you!!</p>
<p dir="auto">To put a website in the mirror, we put the code below in the module folder and<br />
we put the code ‘config.js’ in the ‘MMM-iframe’ in it.<br />
Mirror view will appear normally, but the web site specified in ‘MM-iframe’ will not appear.</p>
<p dir="auto">The picture below shows the ‘npm start and stop’ log.<br />
(아래 사진은 ‘npm start and stop’ 로그입니다.)</p>
<p dir="auto"><img src="/assets/uploads/files/1538621937768-npmn.png" alt="0_1538621935749_npmn.PNG" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.magicmirror.builders/post/44975</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/44975</guid><dc:creator><![CDATA[wltn]]></dc:creator><pubDate>Thu, 04 Oct 2018 03:43:53 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-iframe problem plz help me on Wed, 03 Oct 2018 11:02:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/wltn" aria-label="Profile: wltn">@<bdi>wltn</bdi></a><br />
Give us the error logs or more detailed symptoms.<br />
(한국분이신 거 같아 한글로도 남겨요. 정확히 어떤 증상인지 더 자세한 설명이나 에러로그를 남겨주세요.)</p>
]]></description><link>https://forum.magicmirror.builders/post/44947</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/44947</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 03 Oct 2018 11:02:50 GMT</pubDate></item></channel></rss>