Search code examples
weboslg

LGTV -WebOS - Is there a way to open an URL on the TV browser?


I am developing a web hosting app for the LG/TV WebOS.

I know that the web hosting app is basically running inside a browser engine (webkit?).

When the user is about to make the payment (I am using Paypal because I don't like PaymentWall), the app directs the user to the paypal confirmation page where there is no mean for the user to click on the CORFIRM PURCHASE button. I don't see the "mouse" cursor and there is no documentation I could find about the theme.

So, I was thinking if I could launch that payment page on the tv's browser.

That browser has a cursor that moves when I click the arrows.

Any way to do that? To launch an URL from the app into the television browser? or to make the cursor appear inside the app?


Solution

  • I used this approach.

    openLink(url: string): void {
        webOS.service.request("luna://com.webos.applicationManager", {
            method: "launch",
            parameters: {
                id: "com.webos.app.browser",
                params: {
                    target: url,
                },
            },
            onSuccess: (res: any): void => {
                console.log("Browser open success. ", res);
            },
            onFailure: (res: any): void => {
                console.log("Browser open fail. ", res);
            },
        });
    }
    

    It requires webOS.js or webOSTV.js library.