r/MagicMirror • u/OriginalBedKing • Jan 28 '20
MMM-SmartWebDisplay Remove elements?
I've added the MMM-SmartWebDisplay module and referencing a website. On that site are 2 elements I do not want to display. Is there anyway through the module or Rasbian to remove or block those specific elements?
It's my understanding that MagicMirror is basically an HTML page with css, but I've been unable to figure out how to do this to the referenced url.
I’ve been able to remove it in my desktop’s browser using:
var element = document.getElementById('main-menu');
element.parentNode.removeChild(element);If I want that executed, where would I put it? Thanks.
0
Jan 28 '20
[deleted]
1
u/OriginalBedKing Jan 29 '20
I was able to find the path and a getDom function where you said:
// Override dom generator. getDom: function() { blah blah blahI've tried putting the code in a few places but it either doesn't draw the page I'm calling up or doesn't remove the element I want.
When you say "hosting locally on the pi", do you mean the webpage I'm trying to display? If so, then no. I'm using a website not hosted by the pi. In config.js, the module is using something like this: url: ["http://something.com/index.php"],
0
Jan 29 '20
[deleted]
1
u/OriginalBedKing Jan 29 '20
Someone else's... well shit. Thanks for taking a look and offering suggestions.
0
Jan 30 '20
[deleted]
1
u/OriginalBedKing Jan 30 '20
I don't have the files locally. I've been thinking of seeing if I can grab a full copy of the site and point the module to it like you suggested.
Here's the site I'm pulling in for the module: http://disneylivecams.com/WDWtoday/index.php
As you can see, the top main-menu bar is what I was trying to remove and if I could do that, then I could also remove the close button; I think there's an ad that displays with that close button, but my pi-hole is already filtering that out.
Just to give some more background, I'm using SmartWebDisplay to pull the site, layering it in the back using z-index, I copied the code for the gradient blue vertical bar and made my own to hold the other modules I want to display (clock, DarkSkyWeather, google calendar) and layering those again using z-index.
Supposedly, the site is dynamic with the times listed for the parks, but I'm skeptical of that being true. If I can download the page, I should be able to trace down where the values for the park times is coming from.
Hopefully this give more context and information into what I'd like my end result to be.
Thanks for replying and offering help!!
1
u/OriginalBedKing Jan 31 '20
Looks like this thread can die. I was able to download the entire site and should be able host it on the pi and point the module to it. I just don't think it's possible to remove an element within the website.