Repository navigation
Implement user scripts, script messages and URL schemes - #21
Merged
Merged
Conversation
…Content Pages are made with their schemes, and replies and requests are numbered for the guest. features() says the four.
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.
Implements user scripts, script messages and URL schemes for web views, from PureSwift/AppRuntime#37, over PureSwift/WebKit's
WPEWebContent.Builds on PureSwift/AppRuntime#37, now merged into AppRuntime's
master, which this builds against.LinuxWebContent
features()saysuserScripts,scriptMessages,messageRepliesandurlSchemeswhen WPE WebKit is installed, and nothing when it isn't. It doesn't claim any browser features.make(_:dataStore:options:schemes:)makes the page and registers each scheme withWPEWebContent.registerURLScheme. A scheme WebKit loads itself, such ashttps, is left to it, and a warning is logged.stopURLSchemeTaskon Linux: WPE doesn't say when a page stops wanting a request. The plan's §8 says so.Testing
On aarch64 Debian 13, Swift 6.4.2, WPE 2.48.3 (the development image), with
APPRUNTIME_PATHpointing at AppRuntime#37's branch, as merged:WebContentTests:saysWhatItDoes: the four feature bits.runsUserScriptsAndPassesOnMessages: a document-start script's message arrives before the page's own scripts run, and replies resolve and reject ({"echo":5} | rejected no zeros). Answering twice, or answering an unknown number, is ignored, and once the handler and scripts are removed the next load has neither.servesAPageFromAnAppScheme: a page loads fromtest-linux-app:/index.html, then itsfetchPOSTs to the app's scheme and gets back the status, an exposed header and the body (201 yes stored). A failed request fails the load withnotPermitted.WebContentTestsand the render-node test passed three runs in a row, and every test target passes.