-
Notifications
You must be signed in to change notification settings - Fork 1
OrionBrowserExtension
The class representing a browser extension installed by the user.
Wraps a MozillaBrowserExtensionManifest
class OrionBrowserExtension: NSViewController
NSViewController
, WKNavigationDelegate
, WKURLSchemeHandler
Creates a browser extension object and sets up the toolbar
init(extensionPath path: String, internalIdentifier identifier: String, delegate: OrionBrowserExtensionDelegate)
required init?(coder: NSCoder)
The name of a default manifest. Per mozilla specifications
this name is manifest.json
let manifestName = "manifest.json"
The base path of the extension within the application support directory of the app. Used for all actions that take place within the extension
let extensionPath: URL
The identifier of the extension used for WKContentWorld
s and
folder location. This is a random 32 charector string
let internalIdentifier: String
Boolean value determining whether the extension is enabled or not
var enabled: Bool = true
Defaults to true
The toolbar item that corresponds to the action declared in the manifest if existant.
var toolbarItem: NSToolbarItem?
The delegate of the browser. This spot is usually filled by the OrionExtensionManager
weak var delegate: OrionBrowserExtensionDelegate?
The content world object of the extension.
@available(macOS 11, *)
var contentWorld: WKContentWorld
The manifest of the browser extension. If the json content of the manifest file is malformed or invalid, this will return nil.
lazy var manifest: MozillaBrowserExtensionManifest?
func webView(_ webView: WKWebView, start urlSchemeTask: WKURLSchemeTask)
func webView(_ webView: WKWebView, stop urlSchemeTask: WKURLSchemeTask)
func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!)
func webView(
_ webView: WKWebView,
decidePolicyFor navigationAction: WKNavigationAction,
decisionHandler: @escaping (WKNavigationActionPolicy) -> Void
)
Determines whether or not the extension can be executed on a certain web page
func canExecute(url: URL) -> Bool
- url: The url the extension checks to see if it can run on
Loads the WKWebView
of the popup as the view
property of the object
while also setting its configuration
override func loadView()
Called by the delegate. Loads the extension browser action popup url into the webview and sets the base path to the base of the extension. Finally, it tells the delegate to show the popup
@objc func createPopup()
Generated at 2022-01-11T21:56:49-0800 using swift-doc 1.0.0-rc.1.
Types
- BrowserAction
- MozillaBrowserExtensionManifest
- OptionsUI
- OrionBrowserExtension
- OrionBrowserExtensionError
- OrionDelegate
- OrionExtensionManager
- OrionMenu
- OrionSearchField
- OrionSearchFieldController
- OrionTabStretcherView
- OrionTabbedLocationViewController
- OrionTopSitesAPI
- OrionUserContentController
- OrionWindowController
- OrionWindowType