Hi guys,
I’m trying to modify the Camera Input widget, I would use to open the link of a web page within a pop-up window, instead of using the standard HG link widget, (which allows to open a link by opening a new broswer window).
Is there anyone who can kindly direct me in the right way, or who has already done something similar?
Thank you
Possibly use a Generic widget and embed a url in it. Obviously you won’t get a camera preview that way but it should open your camera via the browser.
Hello Peter,
I believe I have not explained clearly.
What I’m trying to do is modify the Generic Link widget, because I would like the content of the web page to be displayed in a Pop-Up window directly on HG, rather than on a new page of the broswer (as it happens now).
I’m trying to take inspiration from the Camera widget, because when you click on this widget, a Pop-up window opens with the enlarged images of the camera.
There should be some useful snippets of code you could reuse for your purposes here http://old.homegenie.club:8080/www.homegenie.it/forum/index620a.html?topic=1530.0
For the moment I have solved by changing the Javascript section of the Generic Link widget in this way:
(When I have time I will try to update it as I thought):
if (!this.Initialized) {
this.Initialized = true;
var groupname = this.GroupName;
var w = 800;
var h = 500;
var l = Math.floor((screen.width-w)/2);
var t = Math.floor((screen.height-h)/2);
widget.on(‘click’, function () {
//HG.Automation.Programs.Run(module.Address, groupname, null);
if (link != ‘’) {
window.open(link.Value, “”,“width=” + w + “,height=” + h + “,top=” + t + “,left=” + l);
In this way, by clicking on the link created, instead of leaving the HG page, a Pop-Up window is opened in the center of the screen from which you can navigate, and close it again when finished.
That’s perfect. You really are starting to make HG your own now. That was a nice bit of lateral thinking.
I’ve been wishing to do something like this for a while but never got around to playing with it. I decided to play with this today but it still pops up as a separate web page for me so I’ve missed something in your code.
Hi Tuiceman,
are you testing using PC or Phone/Tabet?
HG is running on a Pi but viewing on PC
Ok… I was’nt able to build a pop up… But using the script above, (tested with Firefox) a new Windows should open on the center of the screen… It is a new windows, but without any firefox button… And HG should remain on the background of this new windows… (You can change the dimention of the windows according to your need)…
I found the issue! It is the edge browser it opens a new window but you can not specify the size or location.
If I use IE I can size, specify location, tell it to have scrollbars (which I require),add or remove tool bar and allow resizing.
Nice one @roberto1979. Just like the old days. A solution to a problem. Exactly what this forum needs.
Hi Tuiceman,
above some other test done time ago… Just remove “//” and the douplicated parts…
if (!this.Initialized) {
this.Initialized = true;
//
var groupname = this.GroupName;
var w = 950;
var h = 550;
var l = Math.floor((screen.width-w)/2);
var t = Math.floor((screen.height-h)/2);
//var stile = "top=10, left=10, width=800, height=400, status=no, menubar=no, titlebar=no toolbar=no scrollbars=no";
widget.on('click', function () {
//HG.Automation.Programs.Run(module.Address, groupname, null);
if (link != '') {
window.open(link.Value, "","width=" + w + ",height=" + h + ",top=" + t + ",left=" + l);
//window.open(link.Value, "", stile);
//window.open(link.Value, "", "channelmode");
}
});
Thanks, I’ll play a bit more with this today in edge I can live with the new window being full size. However being able to have it pop up as a smaller screen makes it feel like it is part of HG.
I tested this on my Android phone (default browser) and it just pops up a full sized new window but I’d need it like that any way to be able to read it LOL
Same thing for me on Android Tablet and Chrome (New big windows)… Aniway better than default because without toolbar and menubar… and once the windows will be closed there, there is again HG without toolbar… (You can create an HG link from Chrome)… The perfect way would be pop-up HG Windows…Please, let me know for update…
Still Edge ignores all comments other then opening it in another window instead of a tab. Most of the time I’ll access this from my phone so size is not a big deal.
Ive been playing with viewing webpages & RSS feeds in a widget using Iframes this allows you to scroll through the info. Since you can specify the widget size I believe you could add button to toggle size options. However currently my sizes work fine for my situation.
I believe @soxfan1966 has played with iframe and widget sizing for his sports score and stock ticker widgets as well.
I am away on vacation for a few weeks so do not have access to the code I was working on - I can look into it when I get back toward the end of the month. Thanks