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.7k 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

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • 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