This interfaces with the GeckoView internal API which has been added in previous parts to expose a GeckoView-like interface to an example browser application. Currently this xcode project is not hooked into mozillabuild and needs to be built & run separately. This should be changed in the future, with the GeckoView framework extracted so that it can be used by other projects (e.g. Firefox for iOS). In addition, bundling of XUL is done using a bash script and rsync. While this is functional for local testing, it should be improved with better iOS support in the build system in the future. Differential Revision: https://phabricator.services.mozilla.com/D236420
22 lines
648 B
Swift
22 lines
648 B
Swift
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/
|
|
|
|
import BrowserEngineKit
|
|
import GeckoView
|
|
|
|
@main
|
|
class WebContent : NSObject, GeckoProcessExtension, WebContentExtension {
|
|
override required init() {}
|
|
|
|
func handle(xpcConnection: xpc_connection_t) {
|
|
GeckoRuntime.childMain(xpcConnection: xpcConnection, process: self)
|
|
}
|
|
|
|
func lockdownSandbox(_ version: String!) {
|
|
if version == "1.0" {
|
|
self.applyRestrictedSandbox(revision: .revision1)
|
|
}
|
|
}
|
|
}
|