Open Web Browser on specific website
elisiariocouto opened this issue ยท 8 comments
Hello.
I've successfully managed to connect to my Web OS TV and I can open the web browser. Is it possible to open the web browser on a specific website?
Thanks in advance
I've found that passing a params property with a target key on the request works. Is there any way of putting a website on fullscreen?
I've just done it by controlling the mouse cursor:
lgtv.on('connect', function () {
console.log('connected');
lgtv.getSocket('ssap://com.webos.service.networkinput/getPointerInputSocket',
function(err, sock) {
if (!err) {
const command = "move\n" + "dx:" + 11 + "\n" + "dy:-8\n" + "down:0\n" + "\n";
for (let i=0; i < 22; i++) {
sock.send(command);
}
setTimeout(()=>sock.send('click'), 1000);
}
}
);I've managed to put the browser in fullscreen with the mouse cursor. Thanks @ciberado !
Thank you @ciberado for the fullscreen tip !
Wow, what a brilliant solution! Thx you @ciberado, you save my day!
Thanks for the script, it works ๐ However, when I try to add a disconnect to it, for some reason it is not working anymore. For example, the script I was hoping to use:
lgtv.on('connect', function () { lgtv.request('ssap://com.webos.applicationManager/listLaunchPoints', function (err, res) { var launchPoints = res.launchPoints; }); lgtv.request('ssap://system.launcher/launch', {id: 'com.webos.app.browser', target: 'http://google.com'}); lgtv.getSocket('ssap://com.webos.service.networkinput/getPointerInputSocket', function(err, sock) { if (!err) { const command = "move\n" + "dx:" + 11 + "\n" + "dy:-8\n" + "down:0\n" + "\n"; for (let i=0; i < 22; i++) { sock.send(command); } setTimeout(()=>sock.send('click'), 1000); } } ); lgtv.disconnect(); });
...will not move the cursor. Then, if I comment out lgtv.disconnect(); the cursor moves and puts browser to full screen. The script however runs until I force it to quit. What would be the correct syntax to gracefully close the connection?
Dear all,
I'm new to this communitiy and stumbled over this community when searching for a solution for exact same challenge: Would like to launch a video on a LG TV in full screen mode but it only uses the full browser area. Ciberado's code would actually be a nice work around. Though I'm expierenced enough to apply the idea for my purpose. I use OpenHAB 3 and envision to write a script using the this code. Ciberado or anyone else: can pls. somebody help me with the following questions:
- What language is the code?
- Can I use this language in OpenHAB 3? (I'm only aware of Java and somekind of OpenHAB specific languages Blcokly and DSL)
Any comments are highly appreciated!
Thanks a lot in advance