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.

    iFrame blank when displaing http://<ipaddress LMS server>:9000/material

    Scheduled Pinned Locked Moved Solved Troubleshooting
    27 Posts 3 Posters 4.0k 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.
    • S Offline
      stephanvdplas @stephanvdplas
      last edited by stephanvdplas

      @stephanvdplas in the network tab I see errors:

      688928ea-1d2d-44ee-be59-069f0ae873ee-image.png
      This Set-Cookie header didn’t specify a “SameSite” attribute and was defaulted to “SameSite=Lax”, and was blocked because it came from a cross-site response which was not the response to a top-level navigation. The Set-Cookie had to have been set with “SameSite=None to enable cross-site usage.”

      S karsten13K S 3 Replies Last reply Reply Quote 0
      • S Do not disturb
        sdetweil @stephanvdplas
        last edited by

        @stephanvdplas said in iFrame blank when displaing http://<ipaddress LMS server>:9000/material:

        Set-Cookie header didn’t specify a “SameSite” attribute and was defaulted to “SameSite=Lax”

        Ok, I don’t KNOW for certain, but our cors proxy might work there

        change the url in the iframe config to

        http://localhost:MM_PORT/cors?

        the rest like this

        // the url 
        url=http://www.test.com/path?param1=value1 // example
        // if there are headers, skip if not 
        &sendheaders=header1:value1,header2:value2&expectedheaders=header1,header2
        

        make sure quotes around the url string

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        S 1 Reply Last reply Reply Quote 0
        • karsten13K Offline
          karsten13 @stephanvdplas
          last edited by

          @stephanvdplas

          mm has a simple internal cors proxy you could try.

          So instead using the <original-url> in the iframe you could try http://localhost:8080/cors?url=<original-url>.

          E.g. if your <original-url> is https://example.com try http://localhost:8080/cors?url=https://example.com

          karsten13K 1 Reply Last reply Reply Quote 0
          • karsten13K Offline
            karsten13 @karsten13
            last edited by

            ups, sam was quicker …

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

              @sdetweil said in iFrame blank when displaing http://<ipaddress LMS server>:9000/material:

              @stephanvdplas said in iFrame blank when displaing http://<ipaddress LMS server>:9000/material:

              Set-Cookie header didn’t specify a “SameSite” attribute and was defaulted to “SameSite=Lax”

              Ok, I don’t KNOW for certain, but our cors proxy might work there

              change the url in the iframe config to

              http://localhost:MM_PORT/cors?

              the rest like this

              // the url 
              url=http://www.test.com/path?param1=value1 // example
              // if there are headers, skip if not 
              &sendheaders=header1:value1,header2:value2&expectedheaders=header1,header2
              

              make sure quotes around the url string’’

              It doesn’t work. Now there are no errors, but it only shows an empty frame.
              a71fc225-e33a-4d2a-87c8-18801131aa13-image.png

              In the Preview tab, it shows {{snackbar.msg}}
              [24-09-18 22:33:38.8839] Slim::Utils::Misc::msg (1319) Warniing : [22:33:38.8838] “my” variable $mobile masks earlier declaration in same scope at (eval 5777) line 46.

              This warning is also seen in the debug log of LMS server, also when I open the 192.168.3.8/material on a browser on a windows machine (where the site is loading correctly).

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

                @stephanvdplas There is another thing:

                In the preview tab of the content it shows: Failed to load response data: Connection is closed, can’t dispatch pending call to Network.getResponseBody

                S 1 Reply Last reply Reply Quote 0
                • S Do not disturb
                  sdetweil @stephanvdplas
                  last edited by

                  @stephanvdplas now I am out of my knowledge range.

                  @karsten13 maybe has more skill here…

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  karsten13K 1 Reply Last reply Reply Quote 0
                  • karsten13K Offline
                    karsten13 @sdetweil
                    last edited by

                    @sdetweil said in iFrame blank when displaing http://<ipaddress LMS server>:9000/material:

                    @karsten13 maybe has more skill here…

                    sorry, no. Maybe google has some findings.

                    karsten13K S 2 Replies Last reply Reply Quote 0
                    • karsten13K Offline
                      karsten13 @karsten13
                      last edited by

                      you could try adding

                              electronOptions: {
                                      webPreferences: { webSecurity: false },
                              },
                      

                      in config.js

                      1 Reply Last reply Reply Quote 0
                      • S Offline
                        stephanvdplas @karsten13
                        last edited by

                        @karsten13 good option. I tried it (actually I placed the option directly in the electron.js script) but it doesn’t change the situation at all.

                        karsten13K 1 Reply Last reply Reply Quote 0
                        • karsten13K Offline
                          karsten13 @stephanvdplas
                          last edited by

                          @stephanvdplas

                          I can only guess without having the debug case …

                          You can google and try changing electronOptionsDefaults and/or electronSwitchesDefaults in js/electron.js if you find something …

                          S 1 Reply Last reply Reply Quote 0
                          • S Offline
                            stephanvdplas @karsten13
                            last edited by

                            @karsten13 I am quite sure about having the config right:

                            	let electronSwitchesDefaults = ["autoplay-policy", "no-user-gesture-required"];
                            	app.commandLine.appendSwitch(...new Set(electronSwitchesDefaults, config.electronSwitches));
                            	let electronOptionsDefaults = {
                            		width: electronSize.width,
                            		height: electronSize.height,
                            		icon: "mm2.png",
                            		x: 0,
                            		y: 0,
                            		darkTheme: true,
                            		webPreferences: {
                            			contextIsolation: true,
                            			nodeIntegration: false,
                            			zoomFactor: config.zoom,
                            			webSecurity: false
                            		},
                            		backgroundColor: "#000000"
                            	};
                            
                            	// DEPRECATED: "kioskmode" backwards compatibility, to be removed
                            	// settings these options directly instead provides cleaner interface
                            	if (config.kioskmode) {
                            		electronOptionsDefaults.kiosk = true;
                            	} else {
                            		electronOptionsDefaults.show = false;
                            		electronOptionsDefaults.frame = false;
                            		electronOptionsDefaults.transparent = true;
                            		electronOptionsDefaults.hasShadow = false;
                            		electronOptionsDefaults.fullscreen = true;
                            	}
                            
                            	const electronOptions = Object.assign({}, electronOptionsDefaults, config.electronOptions);
                            
                            	// Create the browser window.
                            	mainWindow = new BrowserWindow(electronOptions);
                            
                            

                            So the webSecurity line is the only thing I added/changed.

                            karsten13K S 2 Replies Last reply Reply Quote 0
                            • karsten13K Offline
                              karsten13 @stephanvdplas
                              last edited by

                              @stephanvdplas said in iFrame blank when displaing http://<ipaddress LMS server>:9000/material:

                              I am quite sure about having the config right

                              sorry, my point is you have to google the error with the keyword “electron” and check if you find something which you can test

                              S 1 Reply Last reply Reply Quote 0
                              • S Offline
                                stephanvdplas @karsten13
                                last edited by

                                @karsten13 sorry to report that there is no other possibility than to revert back to electron 30.0.0
                                After this, the iFrame works again. After re-installing 31.0.0, it is broken again.
                                So no I have implemented this workaround.

                                sudo npm install electron@30.0.0
                                

                                this command saved my life mirror

                                1 Reply Last reply Reply Quote 0
                                • S Do not disturb
                                  sdetweil @stephanvdplas
                                  last edited by

                                  @stephanvdplas unrelated to your problem is your solution technique.

                                  we provide access to these settings in config.js so you DON’T edit our code, as this causes update problems.

                                  Sam

                                  How to add modules

                                  learning how to use browser developers window for css changes

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

                                    @sdetweil said in iFrame blank when displaing http://<ipaddress LMS server>:9000/material:

                                    @stephanvdplas unrelated to your problem is your solution technique.

                                    we provide access to these settings in config.js so you DON’T edit our code, as this causes update problems.

                                    ok understood. But but both ways don’t work. Only thing that helps is reverting the installation of electron to 30.0.0.

                                    S 1 Reply Last reply Reply Quote 0
                                    • S Do not disturb
                                      sdetweil @stephanvdplas
                                      last edited by

                                      @stephanvdplas i understand, looks like something changed in 31, which can be a bug as well.

                                      you’ve got a workaround in the near term.

                                      id open an issue on the MagicMirror github page with the error and a link to this topic so we don’t lose it.
                                      finding a test environment will be the tough thing

                                      Sam

                                      How to add modules

                                      learning how to use browser developers window for css changes

                                      karsten13K S 2 Replies Last reply Reply Quote 0
                                      • karsten13K Offline
                                        karsten13 @sdetweil
                                        last edited by

                                        @sdetweil said in iFrame blank when displaing http://<ipaddress LMS server>:9000/material:

                                        @stephanvdplas i understand, looks like something changed in 31, which can be a bug as well.

                                        you’ve got a workaround in the near term.

                                        id open an issue on the MagicMirror github page with the error and a link to this topic so we don’t lose it.
                                        finding a test environment will be the tough thing

                                        no, we don’t need another issue we cannot solve.

                                        The problem is chromium which is becoming stricter with every release and with every new electron version you get a new chromium version:

                                        electron	Chromium
                                        31.4.0		126.0.6478.23
                                        31.3.1		126.0.6478.185
                                        31.3.0		126.0.6478.183
                                        31.2.0		126.0.6478.127
                                        31.1.0		126.0.6478.114
                                        31.0.2		126.0.6478.61
                                        31.0.0		126.0.6445.0
                                        30.1.0		124.0.6367.243
                                        30.0.9		124.0.6367.233
                                        30.0.8		124.0.6367.230
                                        30.0.7		124.0.6367.221
                                        30.0.5		124.0.6367.207
                                        30.0.4		124.0.6367.201
                                        30.0.3		124.0.6367.119
                                        30.0.2		124.0.6367.91
                                        30.0.1		124.0.6367.60
                                        30.0.0		124.0.6323.0
                                        

                                        Maybe related to this changed in Chromium 125.

                                        We have to deal with this and downgrading chromium (indirect by downgrading electron) is no real solution.

                                        S 1 Reply Last reply Reply Quote 0
                                        • S Do not disturb
                                          sdetweil @karsten13
                                          last edited by

                                          @karsten13 said in iFrame blank when displaing http://<ipaddress LMS server>:9000/material:

                                          We have to deal with this

                                          and how do you proose we do that with all the other things on our plate.
                                          documenting the issue so we can work on ‘dealing’ with it. is the only way in my opinion

                                          Sam

                                          How to add modules

                                          learning how to use browser developers window for css changes

                                          karsten13K 1 Reply Last reply Reply Quote 0
                                          • karsten13K Offline
                                            karsten13 @sdetweil
                                            last edited by

                                            @sdetweil

                                            I won’t stop you from opening an issue …

                                            1 Reply Last reply Reply Quote 0
                                            • S stephanvdplas has marked this topic as solved on

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