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.

    set 'X-Frame-Options' to 'sameorigin'.

    Scheduled Pinned Locked Moved Troubleshooting
    6 Posts 4 Posters 1.4k Views 4 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
      MichaelKrems
      last edited by

      how can i disable x-frame options on the MM. i Want to see the MM in a Iframe on iobroker
      thanks for help

      A 1 Reply Last reply Reply Quote 0
      • A Offline
        ashishtank Module Developer @MichaelKrems
        last edited by

        @MichaelKrems Considering you know what you are doing suggesting below.

        Change below line in server.js, let me know if that works.

        	app.use(helmet({ contentSecurityPolicy: false }));
        

        to

        	app.use(helmet({ contentSecurityPolicy: false, frameguard: false }));
        

        It should work as below

        c4d051a7-de1a-43a8-9fe3-42bddc80dc9b-image.png

        1 Reply Last reply Reply Quote 0
        • M Offline
          MichaelKrems
          last edited by MichaelKrems

          No
          still same error
          “Refused to display ‘http://10.0.0.192:8080/’ in a frame because it set ‘X-Frame-Options’ to ‘sameorigin’.”

          MM and IoBroker not on the same Pi
          iobroker 10.0.0.x1
          MM 10.0.0.x2

          1 Reply Last reply Reply Quote 0
          • M Offline
            MichaelKrems
            last edited by

            Thanks

            after clearing cache in chrome it works

            1 Reply Last reply Reply Quote 0
            • H Offline
              hedmondjohn
              last edited by

              X-Frame-Options is a header included in the response to the request to state if the domain requested will allow itself to be displayed within a frame. It has nothing to do with javascript or HTML, and cannot be changed by the originator of the request. You can’t set X-Frame-Options on the iframe. That is a response header set by the domain from which you are requesting the resource . They have set the header to SAMEORIGIN in this case, which means that they have disallowed loading of the resource in an iframe outside of their domain. So you cannot embed their website into yours. Browsers when see that the response header contains X-Frame-Options: SAMEORIGIN, they check your domain and block the rendering of the <iframe>. It is a security measure to avoid clickjacking.

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

                @hedmondjohn

                see https://github.com/MichMich/MagicMirror/pull/2850

                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