Navigation

    MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    MagicMirror² v2.15.0 is available! For more information about this release, check out this topic.

    New windows, NOT full size

    Troubleshooting
    3
    7
    2859
    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
      mortenbirkelund last edited by

      Hi
      I am working on a MagicMirror with touch. Therefore I inserted the following code into the getDom function in the newsfeed module, in order to add a link to the news, so a new browser window will open and i can read the whole news in a browserwindow.

      			var url = this.newsItems[this.activeItem].url;
      			wrapper.addEventListener("click", function () {				
      				window.open(url,'popUpWindow','height=500,width=500');
                  });
      return wrapper;
      

      This works perfect when I run it in my browser (node serveronly), but when I run it normally (npm start), then the new browser window is full size, and therefore the top bare is missing, and the windows cannot be closed again. Is there anyway, to make sure that the new browser windows is not full size when it opens?

      broberg R 2 Replies Last reply Reply Quote 0
      • broberg
        broberg Project Sponsor @mortenbirkelund last edited by

        @mortenbirkelund why not use an iframe? That way you could still have a lot of the other modules visible as well and you could put a timer on it so if you don’t close it it closes itself.

        M 1 Reply Last reply Reply Quote 1
        • R
          roramirez Core Contributors @mortenbirkelund last edited by

          @mortenbirkelund There are options of Electron when you did run

          npm start
          

          Check out the item for electronOptions
          https://github.com/MichMich/MagicMirror/tree/develop#configuration

          M 2 Replies Last reply Reply Quote 0
          • M
            mortenbirkelund @broberg last edited by

            @broberg As far as I could see, Iframe was not and option, due to cross-origin limitations…

            1 Reply Last reply Reply Quote 0
            • M
              mortenbirkelund @roramirez last edited by

              @roramirez but isnt that only for the MagicMirror window? I still want the MagicMirror window to to be fullscreen. I would just like to be able of opening a window that is not full screen.
              Or have i misunderstood the electronOptions?

              1 Reply Last reply Reply Quote 0
              • M
                mortenbirkelund @roramirez last edited by

                @roramirez said in New windows, NOT full size:

                Electron

                Could you please elaborate on ow i could use the Electron to open a browser window that is not full size, even though the magic Mirror browser is in full size?

                1 Reply Last reply Reply Quote 0
                • R
                  roramirez Core Contributors last edited by

                  Well, It’s something at now I dont know how figure out.

                  If main Electron MagicMIrrror app is starter in FullScreen Mode, without menu bar, etc… I think is not possible -maybe yes- create a new window with these attributes and not full screen.

                  Please can you check this
                  https://github.com/electron/electron/blob/master/docs/api/window-open.md

                  Also, by a way is necessary set the Node Integration

                  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 Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                  This forum is using NodeBB as its core | Contributors
                  Contact | Privacy Policy