It is currently April 26th, 2024, 2:20 pm

small webbrowser-window possible?

Get help with creating, editing & fixing problems with skins
Freezecode
Posts: 1
Joined: October 10th, 2018, 3:29 am

Re: small webbrowser-window possible?

Post by Freezecode »

After I read this, and I wanted my website embed on my desktop, and I knew iframes have been discounted I had a go with embedding, using objects. I ended up downloading a local copy of my webpage and then used something like this...

<object data="C:\Users\yourusername\Documents\Rainmeter\Skins\Webpages\downloadedexamplewebpage.html" Height="600" width="450"><embed scr="https://examplewebpage.com" Height="600" width="450">Error: Embedded data could not be displayed. </object>

This almost works like the old iframes did but I still get error codes on any scripts in webpage.
User avatar
jsmorley
Developer
Posts: 22630
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: small webbrowser-window possible?

Post by jsmorley »

No. Rainmeter doesn't know anything about HTML / CSS / Javascript / PHP or anything else web'ish. It's not a browser. WebParser simply downloads whatever is presented in HTML when you connect to a site as "text" that you parse to extract stuff from it.
JamesPlotts
Posts: 2
Joined: September 1st, 2023, 4:18 am

Re: small webbrowser-window possible?

Post by JamesPlotts »

This is what I've been looking for to embed a live weather radar image in the corner of the desktop. I had one before but Windows 10 took it away. I have a custom webpage that pulls the image from a tv news website and refreshes every five minutes.
JamesPlotts
Posts: 2
Joined: September 1st, 2023, 4:18 am

Re: small webbrowser-window possible?

Post by JamesPlotts »

This is the html page for my weather radar:

Code: Select all

<html><head>
<title>KSN Weather Images</title>
<meta http-equiv="refresh" content="360">
<style>
/* resets */
*,
*:before,
*:after {
  box-sizing: border-box;
}
.clearfix:after {
	content: "";
  display: table;
  clear: both;
}
body {
  font-family: Arial,san-serif;
  margin: 0;
  padding: 0;
  color: #000;
  background-color: #FFFFFF;
}
div.container {
  width:100%;
  margin: 0 auto;
}
div.imagerow,
div.imagerowtext {
  width:100%;
  text-align: center;
  margin-bottom: 10px;
  display: table;
}
div.imagerow p {
  margin: 0;
}
div.imagecell {
  float: left;
  width:25%;
  padding: 5px;
  max-height: 250px;
  font-weight: bold;
}
img {
  margin: 0 auto;
  max-width: 100%;
  display:block;
  height:auto;
}
</style>
</head>

<body>
<div class="container">
  <div class="imagerow">
    <div class="radars">
      <img src="https://media.psg.nexstardigital.net/ksnw/weather/images/ksn_nw_radar_8.jpg" style="display: none;">
      <img src="https://media.psg.nexstardigital.net/ksnw/weather/images/ksn_nw_radar_7.jpg" style="display: none;">
      <img src="https://media.psg.nexstardigital.net/ksnw/weather/images/ksn_nw_radar_6.jpg" style="display: none;">
      <img src="https://media.psg.nexstardigital.net/ksnw/weather/images/ksn_nw_radar_5.jpg" style="display: none;">
      <img src="https://media.psg.nexstardigital.net/ksnw/weather/images/ksn_nw_radar_4.jpg" style="display: block;">
      <img src="https://media.psg.nexstardigital.net/ksnw/weather/images/ksn_nw_radar_3.jpg" style="display: none;">
      <img src="https://media.psg.nexstardigital.net/ksnw/weather/images/ksn_nw_radar_2.jpg" style="display: none;">
      <img src="https://media.psg.nexstardigital.net/ksnw/weather/images/ksn_nw_radar_1.jpg" style="display: none;">
    </div>
  </div>

</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script>
$(window).load(function() {
    function sleep(milliseconds) {
      var start = new Date().getTime();
      for (var i = 0; i < 1e7; i++) {
        if ((new Date().getTime() - start) > milliseconds){
          break;
        }
      }
    }

    /* SET PARAMETERS */
    var change_img_time     = 400;
    var wait_end_time		= 5000;
    var pause_time			= change_img_time;
    var transition_speed    = 0;

    var simple_slideshow    = $(".radars"),
        listItems           = simple_slideshow.children('img'),
        listLen             = listItems.length,
        i                   = 0,

        changeList = function () {

            listItems.eq(i).fadeOut(transition_speed, function () {
                i += 1;
                if (i === listLen) {
                    i = 0;
                    sleep(2000);
                }
                listItems.eq(i).fadeIn(transition_speed);
            });

        };

    listItems.not(':first').hide();
    setInterval(changeList, pause_time);
});
</script>



</body></html>
User avatar
Yincognito
Rainmeter Sage
Posts: 7171
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: small webbrowser-window possible?

Post by Yincognito »

JamesPlotts wrote: September 1st, 2023, 4:21 am This is what I've been looking for to embed a live weather radar image in the corner of the desktop. I had one before but Windows 10 took it away. I have a custom webpage that pulls the image from a tv news website and refreshes every five minutes.
So do you have a question, something you don't know how to do, or you're sharing your successful method with others, cause it's not that clear from your posts?

If it's the former and it's just about those images, Rainmeter can do that on it's own via a WebParser measure and an Image meter, no need to embed a Javascript web page in your skin:

https://docs.rainmeter.net/manual/measures/webparser/#Download
https://docs.rainmeter.net/manual/meters/image/

If you still want to embed the local webpage into a skin, one way to do it would be by using the WebView plugin, though this will be a bit less flexible in some cases and might need other dependencies to be installed on your machine (you can check my Earth skin in my signature for a more complex case):

https://forum.rainmeter.net/viewtopic.php?t=39233
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth