Add ExecuteScript APIs and PopupRequested event - #276
Open
CypherPotato wants to merge 2 commits into
Open
Conversation
CypherPotato
marked this pull request as ready for review
June 6, 2026 22:13
CypherPotato
marked this pull request as draft
June 6, 2026 22:21
CypherPotato
marked this pull request as ready for review
June 7, 2026 15:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two browser-control APIs to PhotinoWindow:
The async script API wraps the user script in an internal callback envelope, executes it in the page, and completes a TaskCompletionSource from an internal window.external.sendMessage response. Results are JSON-serialized in JavaScript and converted back to .NET primitives, lists, dictionaries, or null.
PopupRequested exposes browser new-window requests such as window.open(...) and target=_blank. PopupRequestedEventArgs includes the requesting PhotinoWindow, URL, target name, optional X/Y/Width/Height, and a Handled flag. Setting Handled=true asks the native layer to suppress the browser engine's default popup handling.
Native dependency
Depends on tryphotino/photino.Native#179, which adds the Photino_ExecuteScript native export and popup-request callback used by this wrapper.
Before this PR is marked ready, the Photino.Native package dependency should be coordinated with the native PR release so the managed package does not depend on a native package missing the new export/callback contract.
Behavior notes
Validation