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.

    Create a clone of MMM-Webview

    Scheduled Pinned Locked Moved General Discussion
    6 Posts 2 Posters 661 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.
    • S Offline
      sdetweil @Johanba
      last edited by

      @Johanba I think there are too many changes to the module to make copies…

      see this
      https://github.com/Tom-Hirschberger/MMM-EmbedURL
      enable webview in the MagicMirror config.js per the doc

      then you can use multiple instances

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 0
      • JohanbaJ Offline
        Johanba
        last edited by

        Thanks for the information, Looks like it might be possible

        Looking at the code and not really making sense to me (I am not a developer)
        Say I want to show 3 x dashboards from my Home Assistant
        On Page 2 - >http://192.168.1.90:8123/new-solar-dashboard-combined/deye<
        On Page 3 - >http://192.168.1.90:8123/testing-3/0<
        On Page 4 - >http://192.168.1.90:8123/battery-insights-2/0<

        How would the config.js handle these on different pages
        I am using MMM-pages to have different pages

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

          @Johanba i think you can do 3 instances of embedurl and use classes: for page2…etc

          altho EmbedUrl can do multiple embeds w one instance, you need a different implementation to get to use pages.
          so use multiple module instances just like you were trying with webview
          like this
          need these options before the modules:[ list

          	ignoreXOriginHeader: true,
          	ignoreContentSecurityPolicy: true,
          	electronOptions: {
          		webPreferences: {
          			webviewTag: true,
          		}
          	},
          	modules: [
          
          		{
          		module: "MMM-EmbedURL",
          		position: "top_center",
          		header: "Embed-URL1",
          		classes:"page2",
          		config: {
          			updateInterval: 120,
          			embedElementType: "webview",
          			attributes: [
          				"frameborder=0",
          			],
          			embed: [
          				"https://magicmirror.builders/",
          			]
          		},
          },
          	{
          	module: "MMM-EmbedURL",
          	position: "bottom_center",
          	header: "Embed-URL",
          	classes:"page3",
          	config: {
          		updateInterval: 120,
          		attributes: [
          			"frameborder=0",
          		],
          		embedElementType: "webview",
          		embed: [
          			"https://youtube.com",
          		]
          	},
          },
          

          Sam

          How to add modules

          learning how to use browser developers window for css changes

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

            @Johanba make sure you use the MMM-pages classes/alternative approach to page definition, for example

             	{
             		module: "MMM-pages",
             		disabled:false,
             		config: {
             			modules: [
             				["page1"],
             				["page2"],
             				["page3"],
             			],
             			fixed: [
             				"fixed"
             			],
             			hiddenPages: {
             				"page4": ["page4"],
             			},
            
             			animationTime: 0,
             			rotationTime: 10000,
             		}
             	},
            

            then you use the classes property at each module

                  module: "foo",
                  classes:"page2", (or whatever)
            

            this way you can call the pages anything you want
            mom, dad, taxes, solar, schedules, …

            and a module instance can live on multiple pages

                classes: "mom dad schedules", 
            

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            JohanbaJ 1 Reply Last reply Reply Quote 0
            • JohanbaJ Offline
              Johanba @sdetweil
              last edited by

              @sdetweil
              Thank a mil for the info
              I am going to try and update my config as such, and see how to get this going

              i might reach out again if I am struggling

              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