feat(libSceSystemService): open sceSystemServiceLaunchWebBrowser URLs in the host browser, opt-in with ANYPS5_OPEN_URLS #12895
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12895"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T13:42:13Z.
What
sceSystemServiceLaunchWebBrowser(one URI argument; the null, 6015-byte andhttp:/https:/psno:checks already on main come from a measured library reading) returnedEOPNOTSUPPfor every valid address, so a title that asks for its browser (PPSA76677 falls back to a QR code) got nothing. It can now open the address in the host's default browser, opt-in throughANYPS5_OPEN_URLS=never|ask|always. Unset, empty andneverkeep today's result exactly.Scope note: the requested target was
libSceWebBrowserDialog, but no public source gives the layout of thesceWebBrowserDialogOpenparameter or the offset of its URL field (OpenOrbis-PS4-Toolchain @ 0a1aaf9dd4a92695538bdeb09fb056d06dd11725include/orbis/WebBrowserDialog.hdeclares every function with no parameters; shadPS4 @ f68923fe807f657348e6719ce658bcbd0a2b1c72webbrowserdialog.cpptakes none). The dialog is unchanged except for one debt line saying so. The store and profile dialogs carry ids, not URLs.Design (all host-side, injected behind interfaces):
ValidateHostUrl: onlyhttp://andhttps://, at most 2048 bytes, RFC 3986 characters only (so no control characters, spaces, non-ASCII or look-alike Unicode hosts), percent escapes well formed and not decoding to a control character, no credentials (user@,[email protected]), non-empty host (DNS names or IPv6 literals), port 1 to 65535.IUrlLauncherandIUrlConfirmation;OpenUrlOnHostapplies the mode. An address that fails the validator reaches neither backend in any mode.posix_spawnpofxdg-open(Linux) or/usr/bin/open(macOS) with the address as a single argv element and stdio on /dev/null, never a shell;ShellExecuteWon Windows after revalidating the address. Each backend refuses anything that is not a valid URL by itself.SDL_ShowMessageBox(SDL2-static is now linked into libSceSystemService) showing the whole address, Cancel as the default for Return/Escape; no display means no. It does not use or stack on the overlay dialogs of #12379 (no shared files; the conceptual overlap is "a host dialog"). A mutex serialises launches so two guest threads never stack boxes.EOPNOTSUPP. An invalidANYPS5_OPEN_URLSthrows naming the variable at the first call past the argument checks.Commits (22): validator + test; mode parsing + test; interfaces/policy + test; POSIX backend + test; Windows backend; POSIX launcher revalidation + test; SDL confirmation + test; wiring + test; env reference; usage; five debt statements (one per commit).
Overlap with open PRs: none edit the same lines. #12848 and #12752 also add rows/paragraphs to
docs/dev/ENVIRONMENT.mdanddocs/user/USAGE.mdand touch libSceSystemService (language and date format variables); #12285 touches libSceSystemServiceExport.cppelsewhere. #12379 toucheslibSceMsgDialogand other CMake files, not these.Tested
Linux x86_64, g++ 12, archive build with the host CPU gate patched (
run_tests.sh).guest_system_service_open_url(new),guest_system_service,guest_system_service_language,guest_system_service_time_zone,guest_system_service_usb_storage,guest_system_service_app_title_id_{known,long,missing},loadexec_arguments,guest_system_exit,guest_system_exit_parameters: 11/11 passed.5454cd2e45, second tree): the same ten existing tests, 10/10 passed, identical per test, so the default behaviour is unchanged (the existing test pinsEOPNOTSUPPforhttp:,https:,psno:and the sourced error codes).ctest): 24 mutations, all aborted the test: credentials check removed, control-escape check removed, port upper bound, port zero, scheme prefix loosened, length limit raised, non-ASCII allowed, space allowed, empty host allowed, IPv6 characters unchecked, unknown mode returning never, variable name dropped from the message, policy without validation,askskipping the question,alwaysasking,neverlaunching, launcher failure ignored, POSIX launcher without revalidation, POSIX launcher spawningsh, POSIX launcher reporting failure after spawn, confirmation wrap off, confirmation truncating, confirmation answering yes on SDL failure, wiring ignoring the mode, wiring always returning 0, wiring ignoring the environment, null-argument code changed. The failing line inside the test was not extracted (assertions useabort), so "intended case" is by construction of each mutation, not by line.tools/check_conventions.py --base upstream/main,git diff --check,test_public_headers.py --audit-only,env_reference.py --checkall clean on the final rebased head.x86_64-w64-mingw32-g++ -fsyntax-onlyon the Windows backend.NOT RUN: Windows (ShellExecuteW backend and SDL box), macOS (
openbackend, main-queue dispatch of the box), any real launch of a browser or a real message box (tests use a recording script and fakes; the Linux no-display test only proves the box answers no without a display), a Wayland-only session, a console, a title (PPSA76677). No test rebuild after the final two rebases (my files and the tests are unchanged). The unfixed code was not run against the new tests beyond the baseline list above.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)