Skip to content

Fix plugin section links and dark mode - #26330

Merged
jkmassel merged 2 commits into
trunkfrom
jkmassel/plugin-section-webview-fixes
Nov 3, 2026
Merged

jkmassel merged 2 commits into
trunkfrom
jkmassel/plugin-section-webview-fixes

Conversation

@jkmassel

@jkmassel jkmassel commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Description

Follow-up to #26327, from reviewing it.

Fixes two bugs in the plugin section web view and corrects one comment:

  • "Watch on YouTube" did nothing. The player opens that link with window.open. This doesn't go through the navigation policy, and WebKit ignores it unless the web view has a uiDelegate. The Coordinator now implements createWebViewWith and opens the URL in the browser. The other links in the embed that use window.open get the same fix.
  • Section text was invisible in dark mode. It was black on a dark background, because the page never opted in to dark mode and the web view is transparent. This is pre-existing. Adding color-scheme: light dark fixes it for every section.
  • The baseURL comment said WebKit sends the plugin's page as the referrer. It sends only the origin (https://wordpress.org/). Confirmed by loading httpbin in an iframe.
Before After
Dark mode Dark mode before: the page is black apart from the video Dark mode after: the text is white and readable

What we left alone

  • # links. With the base URL from Fix YouTube embeds in plugin descriptions #26327, these now open in the browser. This is correct: real links like #faq-header and #screenshots point at sections of the WordPress.org page, not at anything in the app's HTML. On trunk they did nothing.
  • http:// images and iframes. The HTTPS base URL blocks them as mixed content. None of the 2,500 plugins we scanned use them.
  • Third-party scripts running with the wordpress.org origin. We trust the WordPress.org filtering, and the app's cookie store had no wordpress.org cookies in our testing.

What I ran

  • I built this change and ran the affected tests locally

WordPressTest/PluginInfoSectionContentTests: Test run with 3 tests in 1 suite passed

Without the CSS change, usesTheTextColorOfTheInterfaceStyle fails with dark → "rgb(0, 0, 0)".

The uiDelegate change has no unit test, because the Coordinator is private and the failure only shows up with a real window.open from the YouTube embed. It was checked in the app, below.

Testing instructions

Checked in Jetpack on an iPhone 18 Pro simulator (iOS 27.0), signed in to a local self-hosted site, with Page Generator installed:

  • In dark mode, Description text is readable.
  • Tapping "Watch on YouTube" opens the video in the browser. Before this change, it did nothing.
  • In light mode, text is still black (covered by the test above).

Not checked: Vimeo embeds, and iPad.

jkmassel added a commit that referenced this pull request Nov 2, 2026
@jkmassel jkmassel self-assigned this Nov 2, 2026
@jkmassel jkmassel added this to the 27.5 milestone Nov 2, 2026
@jkmassel
jkmassel requested a review from crazytonyli November 2, 2026 20:32
Base automatically changed from bugfix/cmm-2524-plugin-description-youtube-embeds to trunk November 2, 2026 21:11
Embeds such as the YouTube player open links with window.open, which WebKit
ignores without a UI delegate. The section text was black on a dark background
because the page didn't opt in to dark mode. Also correct the referrer comment:
WebKit sends the origin, not the plugin's page.
@jkmassel
jkmassel force-pushed the jkmassel/plugin-section-webview-fixes branch from ab757a8 to e7e0ceb Compare November 2, 2026 23:59
@jkmassel
jkmassel added this pull request to the merge queue Nov 3, 2026
Merged via the queue into trunk with commit df69812 Nov 3, 2026
23 checks passed
@jkmassel
jkmassel deleted the jkmassel/plugin-section-webview-fixes branch November 3, 2026 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants