From 0cbe237fd36a5a7aa0a6f4d7ac6d8e0bfa8c40d8 Mon Sep 17 00:00:00 2001
From: Tsung-Han Yu <14802181+johan456789@users.noreply.github.com>
Date: Sun, 15 Feb 2026 14:54:25 +0800
Subject: [PATCH] fix: youtube embed 153 error
youtube expects a referer so instead of file:// url, we need http:// or https:// url
https://developers.google.com/youtube/terms/required-minimum-functionality#youtube-embedded-player-and-video-playback
---
iOS/Article/WebViewController.swift | 12 +++++++++++-
iOS/Resources/page.html | 5 -----
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/iOS/Article/WebViewController.swift b/iOS/Article/WebViewController.swift
index cbca90d03c..91d2f6ba9d 100644
--- a/iOS/Article/WebViewController.swift
+++ b/iOS/Article/WebViewController.swift
@@ -615,7 +615,17 @@ private extension WebViewController {
// try? html.write(to: fileURL, atomically: true, encoding: .utf8)
// print("article.html written to \(fileURL.path)")
- webView.loadHTMLString(html, baseURL: ArticleRenderer.page.baseURL)
+ webView.loadHTMLString(html, baseURL: loadBaseURL(for: rendering.baseURL))
+ }
+
+ private func loadBaseURL(for renderingBaseURL: String) -> URL {
+ if let url = URL(string: renderingBaseURL),
+ let scheme = url.scheme?.lowercased(),
+ scheme == "http" || scheme == "https" {
+ return url
+ }
+
+ return URL(string: "https://netnewswire.com/")!
}
func finalScrollPosition(scrollingUp: Bool) -> CGFloat {
diff --git a/iOS/Resources/page.html b/iOS/Resources/page.html
index 7de2264a5f..0da60d9883 100644
--- a/iOS/Resources/page.html
+++ b/iOS/Resources/page.html
@@ -5,13 +5,9 @@
-
-
-
@@ -20,4 +16,3 @@
[[body]]