Getting NRK working on an older LG TV

9 minute read

Published:

Around two years ago, Norwegian national broadcaster NRK updated their tech stack and suddenly my LG TV from 2019 could no longer play their media on nrk.no. Since then, I’ve wanted my parents to be able to watch and listen to NRK when visiting us in Spain. Open an app on the TV, choose something with the remote, and play it. That was the goal.

As mentioned, my TV could no longer run NRK’s website properly. No error messages. Recently I came across TV Unlock, making me realise that of course I could use a coding agent to modify the TV, and perhaps find a solution. I wanted to keep the TV’s existing apps and country settings, and avoid connecting a laptop over HDMI or leaving my desktop running whenever someone wanted to watch television. So I started investigating whether I could make the website work inside a small webOS app.

News recordings and Radio now work in the cases I’ve tested on the TV, without a desktop server during playback. Login and authenticated live TV are still unfinished. These notes explain how it works, what caught me out, and what I’ll need to remember when something breaks.

The website had moved on

Although no error was shown in user mode, the coding agent in the TV’s developer mode quickly found the error logs allowing us to understand what was wrong.

The first concrete failure was in JavaScript startup. NRK’s page checked for a missing browser feature, URLPattern, and tried to load a polyfill: replacement code for browsers that lack that feature. But the polyfill itself used private class methods, syntax the TV browser could not understand. The compatibility code failed before the main application could start.

There are two different problems here. A missing function can often be supplied by extra JavaScript. Unsupported syntax needs translating before the browser reads it. Adding more polyfills cannot help if the engine rejects the script before executing any of it.

There was another surprise when I moved from the browser to an installed app. The built-in browser identified itself as Chrome 79, but a diagnostic app found Chromium 53 in the app environment. Testing something in the TV browser did not tell me whether it would work in my app. I had to target the older engine and check its behaviour directly.

How the app fits together

I kept NRK’s website and player, and added a compatibility layer around them. The app opens with a Norwegian home screen containing NRK1, NRK2, Radio, News, NRK TV, and Avslutt (Exit). Choosing a shortcut opens the corresponding NRK page inside the app.

The useful mechanism is webOSUserScripts/userScript.js, documented in the webOS Homebrew web development guide. It lets the app supply JavaScript that runs on the loaded page. In this project, that script carries the translated code and layout fixes. Installation uses LG’s Developer Mode; the TV’s firmware and system apps are unchanged.

There are three parts to the process:

  1. Prepare the code on the desktop. Save copies of the public scripts and styles for the supported NRK pages, follow their imports, and translate them for the older engine. The build uses esbuild with a chrome53 target, plus Babel for Unicode regular-expression syntax that needs separate handling.
  2. Package and install the app. Include the translated code, missing browser APIs and layout fixes in the webOS package, then install it through Developer Mode.
  3. Run on the TV. Load NRK’s online page, apply the bundled fixes and start the compatible page code. Pages and media still come from NRK over the internet; the desktop is only needed to build, install and debug the app.

Timing mattered. On this TV, the injected script ran after NRK’s original scripts had already attempted to start. I couldn’t simply add a missing function and expect everything to recover. The app had to restart page initialisation using the translated code. Radio also loads its interface differently from NRK TV, so it needed its own startup adaptation.

Sound, but where was the picture?

Getting the JavaScript to run exposed the next layer of problems: layout.

In an early recording test, sound played but the picture appeared to be missing. The video was actually playing below the visible screen. NRK’s layout used CSS Grid to put the poster and player in the same area. The old engine stacked them vertically instead. A layout fallback brought the video into view.

That was a useful debugging lesson. A symptom that looked like a video problem turned out to be a page-positioning problem. Checking the player’s size and position was just as useful as checking its playback state.

Selecting a programme revealed another failure. The News page showed rows of cards, but the row arrows didn’t work. The click handler expected a CSS gap value and an element scrolling method that this engine lacked. Supplying those missing pieces made the ordinary NRK arrows work and brought the later cards within reach.

There were also programme pages that my first version didn’t handle at all. Opening a recording directly had hidden that omission. The revealing test was the sequence someone would actually use: News → Tidligere sendt (Earlier broadcasts) → programme → dated episode → Play.

This is where the TV remote became part of the engineering problem. A page could look reasonable and still be awkward to use because scrolling, focus or Back behaved badly. The app now handles wheel and arrow scrolling, and Back leaves fullscreen before returning to the previous page. A loading screen gives some feedback while the adapted interface starts; News still took around 11–12.5 seconds to become fully visible in the measured runs.

Where it stands

As of 24 October 2026, the installed build is 0.0.28, with the latest TV checks from 20 October. I confirmed picture, sound, play and pause on a news recording without signing in. The revised News programme-selection flow worked in the household test, as did Radio, including its fullscreen view. Wheel and arrow scrolling were also checked with the physical remote.

The next substantial step is login and authenticated NRK1/NRK2 playback. I also still need to check subtitles, a longer viewing session, reopening the app and keeping the login after a TV restart. Other catalogue sections and podcast pages have incomplete coverage. Radio fullscreen has been visually checked; the latest video-fullscreen sizing fix still needs that same confirmation on screen.

Local automated tests and desktop playback checks help catch regressions while working on the code. The actual TV remains essential: modern desktop Chrome doesn’t reproduce its old layout engine, and a playback timer advancing in the debugger doesn’t prove the picture is visible from the sofa.

Notes for the next time I work on it

The app bundles website code, so maintenance is the main tradeoff. The broadcast list comes from NRK; I don’t need to rebuild for each new episode. Changes to NRK’s scripts, stylesheet filenames or page structure can require a new build, though. There is no automatic updater.

Before a visit, I want to repeat the News selection flow, play Radio, check picture and sound, and try Back and reopening the app. Login and live channels need their own check. I’ll record the date and outcome, including successful checks, so I can eventually judge how much upkeep this needs.

If it breaks, the first job is to save the symptom and the working build before refreshing anything. I keep the captured scripts and styles, generated package, and a manifest with file hashes together. That gives me a way to compare builds and distinguish a site change from a problem that was already there.

Developer Mode is a separate maintenance task. LG’s renewal instructions say to check Remain Session and use EXTEND while online, before expiry. I still need to verify renewal on this TV. Renewing developer access and keeping an NRK login valid are two separate things.

The implementation and app package remain private, including the copied NRK assets. This post is the public record of the experiment. NRK’s normal account and content-availability rules still apply.

Useful resources

I’ve written more generally about the work between a promising demo and usable software in AI Coding Is Not Replacing Engineering. This project is also listed on my Projects page.