It is currently March 28th, 2024, 7:40 pm

small webbrowser-window possible?

Get help with creating, editing & fixing problems with skins
~peter
Posts: 1
Joined: April 17th, 2012, 5:45 am

small webbrowser-window possible?

Post by ~peter »

I´d like to show up a small nagios-page with rainmeter (a little bit like active desktop in windows xp ;) ) - ist this possible?

thanks
Peter
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: small webbrowser-window possible?

Post by jsmorley »

I'm afraid not. Rainmeter is not a web browser and has no such capability. It can download text from a web page with WebParser, but has no understanding of HTML at all. You could do something with a programming language like C++ or C# or even AutoIt to create a little mini web browser object with no frame or controls, but the most Rainmeter would have to do with it would be to launch it with a parameter for a site URL.
User avatar
Echelon5
Posts: 7
Joined: December 5th, 2012, 2:28 pm

Re: small webbrowser-window possible?

Post by Echelon5 »

Thinking about it, you would need to have a 3rd party web-browser. Which can then be opened from the *.ini request.

Though it would need to be a border-less browser, that you can anchor and remove the border :S hmmm.....I will see if I can write one for this. watch this space!!! :sly:
User avatar
Echelon5
Posts: 7
Joined: December 5th, 2012, 2:28 pm

Re: small webbrowser-window possible?

Post by Echelon5 »

Ok...here is my example :D

Its a bit rough around the edges, but hey was a rush job. Let me know what you think.

Here are the steps.

Creating the basic HTA.
Open notepad and add the code below, saving it as Webpage.hta:

Code: Select all

<html>
<body>

<HTA:APPLICATION 
border="none" 
borderStyle="static" 
caption="yes" 
icon="" 
maximizeButton="no" 
minimizeButton="no" 
showInTaskbar="no" 
windowState="normal"
innerBorder="no"
navigable="yes"
scroll="no"
scrollFlat="yes" />

<div style="height: 100%; overflow: hidden;">
   <iframe frameborder=0 allowtransparency=yes scrolling=no src="http://rainmeter.net/forum/viewtopic.php?f=5&t=11876" width="100%" height="100%">
   </iframe>
</div>


</body>
</html>
Creating the Rainmeter skin.
Create an ini file and enter the following text:

Code: Select all

[Rainmeter]
BackgroundMode=1
Author=Echelon5

[MeasureAutostart]
Measure=Calc
Formula=1
IfEqualValue=1
IfEqualAction=["#CURRENTPATH#webpage.hta"]

[MeterConsole2]
Meter=String
AntiAlias=1
x=0
Y=0
Finally save both resulting Webpage.hta and Webpage.ini file's, in the Rainmeter skin folder and you will have a webpage onyour desktop!!!

The only thing you will need to do is find a way of positioning the resulting webpage....hmmmm i'll get back to you!
Last edited by jsmorley on December 14th, 2012, 11:34 pm, edited 1 time in total.
Reason: change quote to code tags
User avatar
Echelon5
Posts: 7
Joined: December 5th, 2012, 2:28 pm

Re: small webbrowser-window possible?

Post by Echelon5 »

Echelon5 wrote:...the only thing you will need to do is find a way of positioning the resulting webpage....hmmmm i'll get back to you!
Ok here is a way around locating the webpage on the desktop and resizing it again! WOOHOO:
<html>
<head>

<SCRIPT LANGUAGE="VBScript">
Sub Window_onLoad
window.resizeTo 400,250
End Sub
</SCRIPT>

<script language="vbscript">
moveto 0,100
resizeto 500,320
</script>

<body>

<HTA:APPLICATION
border="dialog"
borderStyle="static"
caption="no"
icon="http://www.htmlgoodies.com/favicon.ico"
maximizeButton="no"
minimizeButton="no"
showInTaskbar="no"
windowState="normal"
innerBorder="yes"
navigable="yes"
scroll="auto"
scrollFlat="no" />

<div style="height: 100%; overflow: hidden;">
<iframe frameborder=0 allowtransparency=yes scrolling=no src="http://rainmeter.net/forum/viewtopic.php?f=5&t=11876" width="100%" height="100%">
</iframe>
</div>

</body>
</html>
StarburstSpectrum
Posts: 35
Joined: November 28th, 2012, 1:10 pm
Location: Canada

Re: small webbrowser-window possible?

Post by StarburstSpectrum »

This is really cool! :thumbup:

I coupled it with the closeprocess app from here to make it close when the skin is unloaded.

Here's my adaptation of the ini file:

Code: Select all

[Rainmeter]
BackgroundMode=1
Author=Echelon5
OnRefreshAction=["#CURRENTPATH#Webpage.hta"]
OnCloseAction=["#@#\Addons\CloseProcess\CloseProcess.exe" "C:\Windows\System32\mshta.exe"]

[MeterConsole2]
Meter=String
AntiAlias=1
x=0
Y=0

User avatar
Echelon5
Posts: 7
Joined: December 5th, 2012, 2:28 pm

Re: small webbrowser-window possible?

Post by Echelon5 »

StarburstSpectrum wrote:This is really cool! :thumbup:

I coupled it with the closeprocess app from here to make it close when the skin is unloaded.

Here's my adaptation of the ini file:

Code: Select all

[Rainmeter]
BackgroundMode=1
Author=Echelon5
OnRefreshAction=["#CURRENTPATH#Webpage.hta"]
OnCloseAction=["#@#\Addons\CloseProcess\CloseProcess.exe" "C:\Windows\System32\mshta.exe"]

[MeterConsole2]
Meter=String
AntiAlias=1
x=0
Y=0

DUDE!

I was after that CloseApp thingy and couldnt think of it! Dude thanks soo much you lil life saver! lol
User avatar
fragrant.monkey
Posts: 51
Joined: September 18th, 2010, 1:03 am

Re: small webbrowser-window possible?

Post by fragrant.monkey »

Very interesting....

I'm actually using this 'embedded' browser window right now to reply. 8-)

A couple of things though..

. Using mshta.exe to browse the web is a security risk... it has the potential for higher privledges than a regular browser. Use with caution.

. I got it to work directly... (clicking the .hta file), but it won't actually launch for me via the rainmeter skin for some reason... still investigatigating.

. I made a few changes to the hta file: removed redundant duplicate script element that was re-resizing the browser window, and played with the scroll settings to allow scrolling (necessary in a small window of course) and remove non-functioning 'default' scrollbar. I'm sure other items can be culled as well...

Code: Select all

<html>
<head>

<script language="vbscript">
moveto 50,50
resizeto 640,320
</script>

<body>

<HTA:APPLICATION 
border="dialog" 
borderStyle="static" 
caption="no" 
icon="http://www.htmlgoodies.com/favicon.ico" 
maximizeButton="no" 
minimizeButton="no" 
showInTaskbar="no" 
windowState="normal"
innerBorder="yes"
navigable="yes"
scroll="no"
scrollFlat="no" />

<div style="height: 100%; overflow: hidden;">
<iframe frameborder=0 allowtransparency=yes scrolling=yes src="http://rainmeter.net/forum/viewtopic.php?f=5&t=11876" width="100%" height="100%">
</iframe>
</div>

</body>
</html>
Now... to concieve a variable option to allow setting the URL dynamically, and creating a inputText interface to input it.
fun!
fragrant.monkey :: deviantArt: aka snuffleupagus | coding: ThemeSaver for RocketDock | musician: Madera Dulce
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: small webbrowser-window possible?

Post by eclectic-tech »

Pretty neat idea :thumbup: ...

I added a couple of personal tweaks:
  • * Set a caption below the webpage to allow close the config from the skin
    * Zoom to ~75% to fit in the resized window 10 seconds after loading (need NirCmd.exe)
    * Changed the icon to Rainmeter's icon
    * Show DeviantArt's Rainmeter gallery

webpage.hta

Code: Select all

<html>
<head>

<SCRIPT LANGUAGE="VBScript">
Sub Window_onLoad
window.resizeTo 640,480
moveto 300,150
End Sub 
</SCRIPT>

<body>

<HTA:APPLICATION 
border="dialog" 
borderStyle="static" 
caption="no" 
icon="C:\Program Files\Rainmeter\Rainmeter.exe" 
maximizeButton="no" 
minimizeButton="no" 
showInTaskbar="no" 
windowState="normal"
innerBorder="yes"
navigable="yes"
scroll="no"
scrollFlat="no" />

<div style="height: 100%; overflow: hidden;">
<iframe frameborder=0 allowtransparency=yes scrolling=yes src="http://rainmeter.deviantart.com/gallery/" width="100%" height="100%">
</iframe>
</div>

</body>
</html>
webpage.ini

Code: Select all

[Rainmeter]
BackgroundMode=1
Author=Echelon5
OnRefreshAction=["#CURRENTPATH#Webpage.hta"]
OnCloseAction=["#@#\Addons\CloseProcess\CloseProcess.exe" "C:\Windows\System32\mshta.exe"]

[mWait10ZoomOut]
Measure=Calc
Formula=mWait10ZoomOut+1%11
IfEqualValue=10
IfEqualAction=["#@#Addons\NirCmd\NirCmd.exe" SendKeyPress Ctrl+minus Ctrl+minus][!HideMeter Wait][!ShowMeter CloseWebpage][!DisableMeasure mWait10ZoomOut]
;Zoomout 2 times

[CloseWebpage]
Meter=String
AntiAlias=1
X=620
Y=640
W=640
H=20
StringAlign=CENTERCENTER
StringStyle=BOLDITALIC
SolidColor=228,228,228,220
Text="Click to Close Webpage"
LeftMouseUpAction=[!DeActivateConfig]
Hidden=1

[Wait]
Meter=String
MeasureName=mWait10ZoomOut
X=620
Y=640
W=640
H=20
StringAlign=CENTERCENTER
StringStyle=BOLDITALIC
SolidColor=228,228,228,220
Text=Please wait... Preparing to Zoom ... %1
Hidden=0
User avatar
Echelon5
Posts: 7
Joined: December 5th, 2012, 2:28 pm

Re: small webbrowser-window possible?

Post by Echelon5 »

Thanks "fragrant.monkey" lol and you "Electric.Tech".

The security risk isn't too bad as you can change the switch in the HTA file to:
navagable="no". So the user can then only be restricted to the local webpage they are on.

I was unable to locate something that you be able to specify the zoom of the webpage. So thanks Electric-Tech. Do you have the code you used (as it would save me hunting on the site lol!)

lol had another look and found it...soz I R dousch!
IfEqualAction=["#@#Addons\NirCmd\NirCmd.exe" SendKeyPress Ctrl+minus Ctrl+minus][!HideMeter Wait][!ShowMeter CloseWebpage][!DisableMeasure mWait10ZoomOut]
;Zoomout 2 times

Anyhoo, I've been playing and created this google searchbar. You test need to run the HTA file to demo.
You do not have the required permissions to view the files attached to this post.