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.

    Notification from iFrame? (MMM-Glance and ...?)

    Scheduled Pinned Locked Moved Solved Requests
    4 Posts 2 Posters 1.3k Views 2 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.
    • M Offline
      mmmmh Project Sponsor
      last edited by

      I have a web page with some button elements. The web page is shown via MMM-iFrameReload. How can I generate a notification from that web page? I would like to use MMM-Glance to temporarily hide another module.

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

        @mmmmh far as I know, the page in the iframe does not KNOW its in a frame, vs being in a web browser someplace else… and is boxed in a container that it cannot communicate thru (this would be a HUGE security exposure to let a framed page get to outside the frame)

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        M 1 Reply Last reply Reply Quote 0
        • M Offline
          mmmmh Project Sponsor @sdetweil
          last edited by

          @sdetweil Thanks for the feedback. I thought so. I guess I’ll cook something up with MMM-Remote-Control.

          1 Reply Last reply Reply Quote 0
          • M Offline
            mmmmh Project Sponsor
            last edited by mmmmh

            OK, for posterity, here’s what I did.

            I used MMM-Remote-Control and created a button element that calls a function that issues a get request. Interestingly, when I put the URL in the button code the request was rejected (no cross-origin request allowed) but when after I put the URL in the function it worked.

            function toggleCal() {
                        var myUrl = "http://mypi.local:8080/remote?action=TOGGLE&module=MMM-CalendarExt";
                        console.log("getting " + myUrl)
                        var xmlHttp = new XMLHttpRequest();
                        xmlHttp.open("GET", myUrl, false); // false for synchronous request
                        xmlHttp.send(null);
                        return xmlHttp.responseText;
                    };
            

            The button code gets mangled here. I had to add spaces

            < button onclick="toggleCal()">Calender on/off< /button>
            
            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • 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