MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM-EmbedURL with MMM-Pages - Website reload....

    Scheduled Pinned Locked Moved Solved Troubleshooting
    11 Posts 3 Posters 1.4k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • BKeyportB Offline
      BKeyport Module Developer
      last edited by

      I have MMM-pages (@sdetweil 's version) and MMM-EmbedURL (@wishmaster270) - working together on my system. Evertthing is great, EXCEPT this code below.

      What happens is that the website at my docker is loading, then it stops itself and reloads - blanking the screen area for 2-3 seconds while it thinks about it. Unfortunately, even though it’s a docker container and I have “Full control” – it is a very rudimentary program - and the web API is weak at best (Thus the turning off of the time stamp, etc)

      What’s going on here? Is there anything I can do to keep it from blanking and restarting (I think when it’s hidden it’s paused?)

      If it helps, the page is this program -> https://www.clearskyinstitute.com/ham/HamClock/ - you can look around for suggestions.

      Thanks.

      	{
          		module: "MMM-pages",
          		config: {
            			modules: [
              			["page1"],
              			["page2"],
              			["page3"],
            			],
            			animationTime: 2000,
            			rotationTime: 10000,
            		}
            	},
      		{
      			module: "MMM-EmbedURL",
      			position: "top_right",
      			classes: "page2",
      			config: {
      				updateInterval: 3600,
      				animationSpeed: 0, 
      				appendTimestamp: false,
      		
      				embed: [
      					"http://docker.local:8081/live.html",
      					
      				],
      			},
      		},
      

      (any malformed JS above is a paste error, it is correct in code)

      The "E" in "Javascript" stands for "Easy"

      S 1 Reply Last reply Reply Quote 0
      • wishmaster270W Offline
        wishmaster270 Module Developer @sdetweil
        last edited by

        @sdetweil
        Hi Sam,

        you are right. But i do not want the content to be fixed as some users want the content to be recreated after the configured interval.

        I just released a new version 0.0.8 of the module which introduces a updateDomOnShow option. If the option is set to false the module uses the old html elements after a resume. Maybe this fixes the issue.

        S 1 Reply Last reply Reply Quote 1
        • S Offline
          sdetweil @BKeyport
          last edited by

          @BKeyport embedurl doesn’t support the show/hide functions so it COULD be loading at the time it is shown

          It should pause while hidden, resume when shown

          How long does the page take to load?

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          BKeyportB 1 Reply Last reply Reply Quote 0
          • BKeyportB Offline
            BKeyport Module Developer @sdetweil
            last edited by

            @sdetweil

            It shows, then resets, takes 2-3 seconds to show back up, then runs normally. The problem is that it’s just annoying to have it flash in and then blank, then come up and run.

            The "E" in "Javascript" stands for "Easy"

            S 1 Reply Last reply Reply Quote 0
            • S Offline
              sdetweil @BKeyport
              last edited by

              @BKeyport not sure @wishmaster270 got any ideas?

              Looks like you are creating new elements on each getDom(). the resume () will cause a getDom() which will cause the page reload in the new iframe object

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              wishmaster270W 1 Reply Last reply Reply Quote 0
              • wishmaster270W Offline
                wishmaster270 Module Developer @sdetweil
                last edited by

                @sdetweil Hi, the module calls the updateDom function every time it gets resumed in the current implementation.

                I am not sure if I can implemt a block option to skip the update dom but reset the timer for the regular updates.

                S 1 Reply Last reply Reply Quote 0
                • S Offline
                  sdetweil @wishmaster270
                  last edited by

                  @wishmaster270 you could make the content you return fixed …

                  getDom(){
                      if(!this.already_created){
                         build content
                         this.already_created=new content
                      }
                      return this.already_created 
                  }
                  

                  I do this in a few modules to reduce/eliminate the flash

                  nothing says you HAVE to CREATE the content on each getDom()
                  just have to return something

                  so minor change… no logic change

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  wishmaster270W 1 Reply Last reply Reply Quote 0
                  • wishmaster270W Offline
                    wishmaster270 Module Developer @sdetweil
                    last edited by

                    @sdetweil
                    Hi Sam,

                    you are right. But i do not want the content to be fixed as some users want the content to be recreated after the configured interval.

                    I just released a new version 0.0.8 of the module which introduces a updateDomOnShow option. If the option is set to false the module uses the old html elements after a resume. Maybe this fixes the issue.

                    S 1 Reply Last reply Reply Quote 1
                    • S Offline
                      sdetweil @wishmaster270
                      last edited by

                      @wishmaster270 thanks… I didn’t know if the iframe would reload itself on show

                      @BKeyport give this a try

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      BKeyportB 1 Reply Last reply Reply Quote 0
                      • BKeyportB Offline
                        BKeyport Module Developer @sdetweil
                        last edited by

                        Tom, is it updateDomOnShow or updateDomOnResume ?

                        Documentation shows the latter.

                        The "E" in "Javascript" stands for "Easy"

                        BKeyportB 1 Reply Last reply Reply Quote 0
                        • BKeyportB Offline
                          BKeyport Module Developer @BKeyport
                          last edited by

                          I put them both in, and that fixed it - thanks, Tom.

                          The "E" in "Javascript" stands for "Easy"

                          wishmaster270W 1 Reply Last reply Reply Quote 1
                          • S sdetweil has marked this topic as solved on
                          • 1
                          • 2
                          • 1 / 2
                          • First post
                            Last post
                          Enjoying MagicMirror? Please consider a donation!
                          MagicMirror created by Michael Teeuw.
                          Forum managed by Sam, technical setup by Karsten.
                          This forum is using NodeBB as its core | Contributors
                          Contact | Privacy Policy