pub unsafe trait WKWebExtensionTab: NSObjectProtocol + MainThreadOnly {
Show 33 methods
// Provided methods
unsafe fn windowForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> Option<Retained<ProtocolObject<dyn WKWebExtensionWindow>>>
where Self: Sized + Message { ... }
unsafe fn indexInWindowForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> NSUInteger
where Self: Sized + Message { ... }
unsafe fn parentTabForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> Option<Retained<ProtocolObject<dyn WKWebExtensionTab>>>
where Self: Sized + Message { ... }
unsafe fn setParentTab_forWebExtensionContext_completionHandler(
&self,
parent_tab: Option<&ProtocolObject<dyn WKWebExtensionTab>>,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSError)>,
)
where Self: Sized + Message { ... }
unsafe fn webViewForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> Option<Retained<WKWebView>>
where Self: Sized + Message { ... }
unsafe fn titleForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> Option<Retained<NSString>>
where Self: Sized + Message { ... }
unsafe fn isPinnedForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> bool
where Self: Sized + Message { ... }
unsafe fn setPinned_forWebExtensionContext_completionHandler(
&self,
pinned: bool,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSError)>,
)
where Self: Sized + Message { ... }
unsafe fn isReaderModeAvailableForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> bool
where Self: Sized + Message { ... }
unsafe fn isReaderModeActiveForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> bool
where Self: Sized + Message { ... }
unsafe fn setReaderModeActive_forWebExtensionContext_completionHandler(
&self,
active: bool,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSError)>,
)
where Self: Sized + Message { ... }
unsafe fn isPlayingAudioForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> bool
where Self: Sized + Message { ... }
unsafe fn isMutedForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> bool
where Self: Sized + Message { ... }
unsafe fn setMuted_forWebExtensionContext_completionHandler(
&self,
muted: bool,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSError)>,
)
where Self: Sized + Message { ... }
unsafe fn sizeForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> CGSize
where Self: Sized + Message { ... }
unsafe fn zoomFactorForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> c_double
where Self: Sized + Message { ... }
unsafe fn setZoomFactor_forWebExtensionContext_completionHandler(
&self,
zoom_factor: c_double,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSError)>,
)
where Self: Sized + Message { ... }
unsafe fn urlForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> Option<Retained<NSURL>>
where Self: Sized + Message { ... }
unsafe fn pendingURLForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> Option<Retained<NSURL>>
where Self: Sized + Message { ... }
unsafe fn isLoadingCompleteForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> bool
where Self: Sized + Message { ... }
unsafe fn detectWebpageLocaleForWebExtensionContext_completionHandler(
&self,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSLocale, *mut NSError)>,
)
where Self: Sized + Message { ... }
unsafe fn takeSnapshotUsingConfiguration_forWebExtensionContext_completionHandler(
&self,
configuration: &WKSnapshotConfiguration,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSImage, *mut NSError)>,
)
where Self: Sized + Message { ... }
unsafe fn loadURL_forWebExtensionContext_completionHandler(
&self,
url: &NSURL,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSError)>,
)
where Self: Sized + Message { ... }
unsafe fn reloadFromOrigin_forWebExtensionContext_completionHandler(
&self,
from_origin: bool,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSError)>,
)
where Self: Sized + Message { ... }
unsafe fn goBackForWebExtensionContext_completionHandler(
&self,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSError)>,
)
where Self: Sized + Message { ... }
unsafe fn goForwardForWebExtensionContext_completionHandler(
&self,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSError)>,
)
where Self: Sized + Message { ... }
unsafe fn activateForWebExtensionContext_completionHandler(
&self,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSError)>,
)
where Self: Sized + Message { ... }
unsafe fn isSelectedForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> bool
where Self: Sized + Message { ... }
unsafe fn setSelected_forWebExtensionContext_completionHandler(
&self,
selected: bool,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSError)>,
)
where Self: Sized + Message { ... }
unsafe fn duplicateUsingConfiguration_forWebExtensionContext_completionHandler(
&self,
configuration: &WKWebExtensionTabConfiguration,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut ProtocolObject<dyn WKWebExtensionTab>, *mut NSError)>,
)
where Self: Sized + Message { ... }
unsafe fn closeForWebExtensionContext_completionHandler(
&self,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSError)>,
)
where Self: Sized + Message { ... }
unsafe fn shouldGrantPermissionsOnUserGestureForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> bool
where Self: Sized + Message { ... }
unsafe fn shouldBypassPermissionsForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> bool
where Self: Sized + Message { ... }
}WKWebExtensionTab only.Expand description
A class conforming to the WKWebExtensionTab protocol represents a tab to web extensions.
See also Apple’s documentation
Provided Methods§
Sourceunsafe fn windowForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> Option<Retained<ProtocolObject<dyn WKWebExtensionWindow>>>
Available on crate features WKWebExtensionContext and WKWebExtensionWindow only.
unsafe fn windowForWebExtensionContext( &self, context: &WKWebExtensionContext, ) -> Option<Retained<ProtocolObject<dyn WKWebExtensionWindow>>>
WKWebExtensionContext and WKWebExtensionWindow only.Called when the window containing the tab is needed.
Parameter context: The context in which the web extension is running.
Returns: The window containing the tab.
Defaults to nil if not implemented.
Sourceunsafe fn indexInWindowForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> NSUInteger
Available on crate feature WKWebExtensionContext only.
unsafe fn indexInWindowForWebExtensionContext( &self, context: &WKWebExtensionContext, ) -> NSUInteger
WKWebExtensionContext only.Called when the index of the tab in the window is needed.
Parameter context: The context in which the web extension is running.
Returns: The index of the tab in the window, or NSNotFound if the tab is not currently in a window.
This method should be implemented for better performance. Defaults to the window’s
tabsForWebExtensionContext: method to find the index if not implemented.
Sourceunsafe fn parentTabForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> Option<Retained<ProtocolObject<dyn WKWebExtensionTab>>>
Available on crate feature WKWebExtensionContext only.
unsafe fn parentTabForWebExtensionContext( &self, context: &WKWebExtensionContext, ) -> Option<Retained<ProtocolObject<dyn WKWebExtensionTab>>>
WKWebExtensionContext only.Called when the parent tab for the tab is needed.
Parameter context: The context in which the web extension is running.
Returns: The parent tab of the tab, if the tab was opened from another tab.
Defaults to nil if not implemented.
See also: setParentTab:forWebExtensionContext:completionHandler:
Sourceunsafe fn setParentTab_forWebExtensionContext_completionHandler(
&self,
parent_tab: Option<&ProtocolObject<dyn WKWebExtensionTab>>,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSError)>,
)
Available on crate features WKWebExtensionContext and block2 only.
unsafe fn setParentTab_forWebExtensionContext_completionHandler( &self, parent_tab: Option<&ProtocolObject<dyn WKWebExtensionTab>>, context: &WKWebExtensionContext, completion_handler: &DynBlock<dyn Fn(*mut NSError)>, )
WKWebExtensionContext and block2 only.Called to set or clear the parent tab for the tab.
Parameter parentTab: The tab that should be set as the parent of the tab. If
nilis provided, the current
parent tab should be cleared.
Parameter context: The context in which the web extension is running.
Parameter completionHandler: A block that must be called upon completion. It takes a single error argument,
which should be provided if any errors occurred.
No action is performed if not implemented.
See also: parentTabForWebExtensionContext:
Sourceunsafe fn webViewForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> Option<Retained<WKWebView>>
Available on crate feature WKWebExtensionContext and crate feature WKWebView and crate feature objc2-app-kit and macOS only.
unsafe fn webViewForWebExtensionContext( &self, context: &WKWebExtensionContext, ) -> Option<Retained<WKWebView>>
WKWebExtensionContext and crate feature WKWebView and crate feature objc2-app-kit and macOS only.Called when the web view for the tab is needed.
Parameter context: The context in which the web extension is running.
Returns: The web view for the tab.
The web view’s WKWebViewConfiguration must have its webExtensionController property set to match
the controller of the given context; otherwise nil will be used. Defaults to nil if not implemented. If nil, some critical features
will not be available for this tab, such as content injection or modification.
Sourceunsafe fn titleForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> Option<Retained<NSString>>
Available on crate feature WKWebExtensionContext only.
unsafe fn titleForWebExtensionContext( &self, context: &WKWebExtensionContext, ) -> Option<Retained<NSString>>
WKWebExtensionContext only.Called when the title of the tab is needed.
Parameter context: The context in which the web extension is running.
Returns: The title of the tab.
Defaults to title of the tab’s web view if not implemented.
Sourceunsafe fn isPinnedForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> bool
Available on crate feature WKWebExtensionContext only.
unsafe fn isPinnedForWebExtensionContext( &self, context: &WKWebExtensionContext, ) -> bool
WKWebExtensionContext only.Called when the pinned state of the tab is needed.
Parameter context: The context in which the web extension is running.
Returns: YES if the tab is pinned, NO otherwise.
Defaults to NO if not implemented.
See also: setPinned:forWebExtensionContext:completionHandler:
Sourceunsafe fn setPinned_forWebExtensionContext_completionHandler(
&self,
pinned: bool,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSError)>,
)
Available on crate features WKWebExtensionContext and block2 only.
unsafe fn setPinned_forWebExtensionContext_completionHandler( &self, pinned: bool, context: &WKWebExtensionContext, completion_handler: &DynBlock<dyn Fn(*mut NSError)>, )
WKWebExtensionContext and block2 only.Called to set the pinned state of the tab.
Parameter pinned: A boolean value indicating whether to pin the tab.
Parameter context: The context in which the web extension is running.
Parameter completionHandler: A block that must be called upon completion. It takes a single error argument,
which should be provided if any errors occurred.
This is equivalent to the user selecting to pin or unpin the tab through a menu item. When a tab is pinned, it should be moved to the front of the tab bar and usually reduced in size. When a tab is unpinned, it should be restored to a normal size and position in the tab bar. No action is performed if not implemented.
See also: isPinnedForWebExtensionContext:
Sourceunsafe fn isReaderModeAvailableForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> bool
Available on crate feature WKWebExtensionContext only.
unsafe fn isReaderModeAvailableForWebExtensionContext( &self, context: &WKWebExtensionContext, ) -> bool
WKWebExtensionContext only.Called to check if reader mode is available for the tab.
Parameter context: The context in which the web extension is running.
Returns: YES if reader mode is available for the tab, NO otherwise.
Defaults to NO if not implemented.
See also: isReaderModeActiveForWebExtensionContext:
Sourceunsafe fn isReaderModeActiveForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> bool
Available on crate feature WKWebExtensionContext only.
unsafe fn isReaderModeActiveForWebExtensionContext( &self, context: &WKWebExtensionContext, ) -> bool
WKWebExtensionContext only.Called to check if the tab is currently showing reader mode.
Parameter context: The context in which the web extension is running.
Returns: YES if the tab is showing reader mode, NO otherwise.
Defaults to NO if not implemented.
See also: isReaderModeAvailableForWebExtensionContext:
Sourceunsafe fn setReaderModeActive_forWebExtensionContext_completionHandler(
&self,
active: bool,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSError)>,
)
Available on crate features WKWebExtensionContext and block2 only.
unsafe fn setReaderModeActive_forWebExtensionContext_completionHandler( &self, active: bool, context: &WKWebExtensionContext, completion_handler: &DynBlock<dyn Fn(*mut NSError)>, )
WKWebExtensionContext and block2 only.Called to set the reader mode for the tab.
Parameter active: A boolean value indicating whether to activate reader mode.
Parameter context: The context in which the web extension is running.
Parameter completionHandler: A block that must be called upon completion. It takes a single error argument,
which should be provided if any errors occurred.
No action is performed if not implemented.
See also: isReaderModeAvailableForWebExtensionContext:
See also: isReaderModeActiveForWebExtensionContext:
Sourceunsafe fn isPlayingAudioForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> bool
Available on crate feature WKWebExtensionContext only.
unsafe fn isPlayingAudioForWebExtensionContext( &self, context: &WKWebExtensionContext, ) -> bool
WKWebExtensionContext only.Called to check if the tab is currently playing audio.
Parameter context: The context in which the web extension is running.
Returns: YES if the tab is playing audio, NO otherwise.
Defaults to NO if not implemented.
Sourceunsafe fn isMutedForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> bool
Available on crate feature WKWebExtensionContext only.
unsafe fn isMutedForWebExtensionContext( &self, context: &WKWebExtensionContext, ) -> bool
WKWebExtensionContext only.Called to check if the tab is currently muted.
Parameter context: The context in which the web extension is running.
Returns: YES if the tab is muted, NO otherwise.
Defaults to NO if not implemented.
See also: setMuted:forWebExtensionContext:completionHandler:
Sourceunsafe fn setMuted_forWebExtensionContext_completionHandler(
&self,
muted: bool,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSError)>,
)
Available on crate features WKWebExtensionContext and block2 only.
unsafe fn setMuted_forWebExtensionContext_completionHandler( &self, muted: bool, context: &WKWebExtensionContext, completion_handler: &DynBlock<dyn Fn(*mut NSError)>, )
WKWebExtensionContext and block2 only.Called to set the mute state of the tab.
Parameter muted: A boolean indicating whether the tab should be muted.
Parameter context: The context in which the web extension is running.
Parameter completionHandler: A block that must be called upon completion. It takes a single error argument,
which should be provided if any errors occurred.
No action is performed if not implemented.
See also: isMutedForWebExtensionContext:
Sourceunsafe fn sizeForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> CGSize
Available on crate features WKWebExtensionContext and objc2-core-foundation only.
unsafe fn sizeForWebExtensionContext( &self, context: &WKWebExtensionContext, ) -> CGSize
WKWebExtensionContext and objc2-core-foundation only.Called when the size of the tab is needed.
Parameter context: The context in which the web extension is running.
Returns: The size of the tab.
Defaults to size of the tab’s web view if not implemented.
Sourceunsafe fn zoomFactorForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> c_double
Available on crate feature WKWebExtensionContext only.
unsafe fn zoomFactorForWebExtensionContext( &self, context: &WKWebExtensionContext, ) -> c_double
WKWebExtensionContext only.Called when the zoom factor of the tab is needed.
Parameter context: The context in which the web extension is running.
Returns: The zoom factor of the tab.
Defaults to pageZoom of the tab’s web view if not implemented.
See also: setZoomFactor:forWebExtensionContext:completionHandler:
Sourceunsafe fn setZoomFactor_forWebExtensionContext_completionHandler(
&self,
zoom_factor: c_double,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSError)>,
)
Available on crate features WKWebExtensionContext and block2 only.
unsafe fn setZoomFactor_forWebExtensionContext_completionHandler( &self, zoom_factor: c_double, context: &WKWebExtensionContext, completion_handler: &DynBlock<dyn Fn(*mut NSError)>, )
WKWebExtensionContext and block2 only.Called to set the zoom factor of the tab.
Parameter zoomFactor: The desired zoom factor for the tab.
Parameter context: The context in which the web extension is running.
Parameter completionHandler: A block that must be called upon completion. It takes a single error argument,
which should be provided if any errors occurred.
Sets pageZoom of the tab’s web view if not implemented.
See also: zoomFactorForWebExtensionContext:
Sourceunsafe fn urlForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> Option<Retained<NSURL>>
Available on crate feature WKWebExtensionContext only.
unsafe fn urlForWebExtensionContext( &self, context: &WKWebExtensionContext, ) -> Option<Retained<NSURL>>
WKWebExtensionContext only.Called when the URL of the tab is needed.
Parameter context: The context in which the web extension is running.
Returns: The URL of the tab.
Defaults to URL of the tab’s web view if not implemented.
Sourceunsafe fn pendingURLForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> Option<Retained<NSURL>>
Available on crate feature WKWebExtensionContext only.
unsafe fn pendingURLForWebExtensionContext( &self, context: &WKWebExtensionContext, ) -> Option<Retained<NSURL>>
WKWebExtensionContext only.Called when the pending URL of the tab is needed.
Parameter context: The context in which the web extension is running.
Returns: The pending URL of the tab.
The pending URL is the URL of a page that is in the process of loading. If there is no pending URL, return nil.
Defaults to nil if not implemented.
Sourceunsafe fn isLoadingCompleteForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> bool
Available on crate feature WKWebExtensionContext only.
unsafe fn isLoadingCompleteForWebExtensionContext( &self, context: &WKWebExtensionContext, ) -> bool
WKWebExtensionContext only.Called to check if the tab has finished loading.
Parameter context: The context in which the web extension is running.
Returns: YES if the tab has finished loading, NO otherwise.
Defaults to isLoading of the tab’s web view if not implemented.
Sourceunsafe fn detectWebpageLocaleForWebExtensionContext_completionHandler(
&self,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSLocale, *mut NSError)>,
)
Available on crate features WKWebExtensionContext and block2 only.
unsafe fn detectWebpageLocaleForWebExtensionContext_completionHandler( &self, context: &WKWebExtensionContext, completion_handler: &DynBlock<dyn Fn(*mut NSLocale, *mut NSError)>, )
WKWebExtensionContext and block2 only.Called to detect the locale of the webpage currently loaded in the tab.
Parameter context: The context in which the web extension is running.
Parameter completionHandler: A block that must be called upon completion. The block takes two arguments:
the detected locale (or
nilif the locale is unknown) and an error, which should be provided if any errors occurred.
No action is performed if not implemented.
unsafe fn takeSnapshotUsingConfiguration_forWebExtensionContext_completionHandler( &self, configuration: &WKSnapshotConfiguration, context: &WKWebExtensionContext, completion_handler: &DynBlock<dyn Fn(*mut NSImage, *mut NSError)>, )
WKSnapshotConfiguration and crate feature WKWebExtensionContext and crate feature block2 and crate feature objc2-app-kit and macOS only.Sourceunsafe fn loadURL_forWebExtensionContext_completionHandler(
&self,
url: &NSURL,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSError)>,
)
Available on crate features WKWebExtensionContext and block2 only.
unsafe fn loadURL_forWebExtensionContext_completionHandler( &self, url: &NSURL, context: &WKWebExtensionContext, completion_handler: &DynBlock<dyn Fn(*mut NSError)>, )
WKWebExtensionContext and block2 only.Called to load a URL in the tab.
Parameter url: The URL to be loaded in the tab.
Parameter context: The context in which the web extension is running.
Parameter completionHandler: A block that must be called upon completion. It takes a single error argument,
which should be provided if any errors occurred.
If the tab is already loading a page, calling this method should stop the current page from loading and start
loading the new URL. Loads the URL in the tab’s web view via loadRequest: if not implemented.
Sourceunsafe fn reloadFromOrigin_forWebExtensionContext_completionHandler(
&self,
from_origin: bool,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSError)>,
)
Available on crate features WKWebExtensionContext and block2 only.
unsafe fn reloadFromOrigin_forWebExtensionContext_completionHandler( &self, from_origin: bool, context: &WKWebExtensionContext, completion_handler: &DynBlock<dyn Fn(*mut NSError)>, )
WKWebExtensionContext and block2 only.Called to reload the current page in the tab.
Parameter fromOrigin: A boolean value indicating whether to reload the tab from the origin, bypassing the cache.
Parameter context: The context in which the web extension is running.
Parameter completionHandler: A block that must be called upon completion. It takes a single error argument,
which should be provided if any errors occurred.
Reloads the tab’s web view via reload or reloadFromOrigin if not implemented.
Sourceunsafe fn goBackForWebExtensionContext_completionHandler(
&self,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSError)>,
)
Available on crate features WKWebExtensionContext and block2 only.
unsafe fn goBackForWebExtensionContext_completionHandler( &self, context: &WKWebExtensionContext, completion_handler: &DynBlock<dyn Fn(*mut NSError)>, )
WKWebExtensionContext and block2 only.Called to navigate the tab to the previous page in its history.
Parameter context: The context in which the web extension is running.
Parameter completionHandler: A block that must be called upon completion. It takes a single error argument,
which should be provided if any errors occurred.
Navigates to the previous page in the tab’s web view via goBack if not implemented.
Sourceunsafe fn goForwardForWebExtensionContext_completionHandler(
&self,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSError)>,
)
Available on crate features WKWebExtensionContext and block2 only.
unsafe fn goForwardForWebExtensionContext_completionHandler( &self, context: &WKWebExtensionContext, completion_handler: &DynBlock<dyn Fn(*mut NSError)>, )
WKWebExtensionContext and block2 only.Called to navigate the tab to the next page in its history.
Parameter context: The context in which the web extension is running.
Parameter completionHandler: A block that must be called upon completion. It takes a single error argument,
which should be provided if any errors occurred.
Navigates to the next page in the tab’s web view via goForward if not implemented.
Sourceunsafe fn activateForWebExtensionContext_completionHandler(
&self,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSError)>,
)
Available on crate features WKWebExtensionContext and block2 only.
unsafe fn activateForWebExtensionContext_completionHandler( &self, context: &WKWebExtensionContext, completion_handler: &DynBlock<dyn Fn(*mut NSError)>, )
WKWebExtensionContext and block2 only.Called to activate the tab, making it frontmost.
Parameter context: The context in which the web extension is running.
Parameter completionHandler: A block that must be called upon completion. It takes a single error argument,
which should be provided if any errors occurred.
Upon activation, the tab should become the frontmost and either be the sole selected tab or be included among the selected tabs. No action is performed if not implemented.
See also: setSelected:forWebExtensionContext:completionHandler:
Sourceunsafe fn isSelectedForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> bool
Available on crate feature WKWebExtensionContext only.
unsafe fn isSelectedForWebExtensionContext( &self, context: &WKWebExtensionContext, ) -> bool
WKWebExtensionContext only.Called when the selected state of the tab is needed.
Parameter context: The context in which the web extension is running.
Returns: YES if the tab is selected, NO otherwise.
Defaults to YES for the active tab and NO for other tabs if not implemented.
Sourceunsafe fn setSelected_forWebExtensionContext_completionHandler(
&self,
selected: bool,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSError)>,
)
Available on crate features WKWebExtensionContext and block2 only.
unsafe fn setSelected_forWebExtensionContext_completionHandler( &self, selected: bool, context: &WKWebExtensionContext, completion_handler: &DynBlock<dyn Fn(*mut NSError)>, )
WKWebExtensionContext and block2 only.Called to set the selected state of the tab.
Parameter selected: A boolean value indicating whether to select the tab.
Parameter context: The context in which the web extension is running.
Parameter completionHandler: A block that must be called upon completion. It takes a single error argument,
which should be provided if any errors occurred.
This is equivalent to the user command-clicking on the tab to add it to or remove it from a selection. The method should update the tab’s selection state without changing the active tab. No action is performed if not implemented.
See also: isSelectedForWebExtensionContext:
Sourceunsafe fn duplicateUsingConfiguration_forWebExtensionContext_completionHandler(
&self,
configuration: &WKWebExtensionTabConfiguration,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut ProtocolObject<dyn WKWebExtensionTab>, *mut NSError)>,
)
Available on crate features WKWebExtensionContext and WKWebExtensionTabConfiguration and block2 only.
unsafe fn duplicateUsingConfiguration_forWebExtensionContext_completionHandler( &self, configuration: &WKWebExtensionTabConfiguration, context: &WKWebExtensionContext, completion_handler: &DynBlock<dyn Fn(*mut ProtocolObject<dyn WKWebExtensionTab>, *mut NSError)>, )
WKWebExtensionContext and WKWebExtensionTabConfiguration and block2 only.Called to duplicate the tab.
Parameter configuration: The tab configuration influencing the duplicated tab’s properties.
Parameter context: The context in which the web extension is running.
Parameter completionHandler: A block that must be called upon completion. It takes two arguments:
the duplicated tab (or
nilif no tab was created) and an error, which should be provided if any errors occurred.
This is equivalent to the user selecting to duplicate the tab through a menu item, with the specified configuration. No action is performed if not implemented.
Sourceunsafe fn closeForWebExtensionContext_completionHandler(
&self,
context: &WKWebExtensionContext,
completion_handler: &DynBlock<dyn Fn(*mut NSError)>,
)
Available on crate features WKWebExtensionContext and block2 only.
unsafe fn closeForWebExtensionContext_completionHandler( &self, context: &WKWebExtensionContext, completion_handler: &DynBlock<dyn Fn(*mut NSError)>, )
WKWebExtensionContext and block2 only.Called to close the tab.
Parameter context: The context in which the web extension is running.
Parameter completionHandler: A block that must be called upon completion. It takes a single error argument,
which should be provided if any errors occurred.
No action is performed if not implemented.
Sourceunsafe fn shouldGrantPermissionsOnUserGestureForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> bool
Available on crate feature WKWebExtensionContext only.
unsafe fn shouldGrantPermissionsOnUserGestureForWebExtensionContext( &self, context: &WKWebExtensionContext, ) -> bool
WKWebExtensionContext only.Called to determine if permissions should be granted for the tab on user gesture.
Parameter context: The context in which the web extension is running.
Returns: YES if permissions should be granted to the tab, NO otherwise.
This method allows the app to control granting of permissions on a per-tab basis when triggered by a user
gesture. Implementing this method enables the app to dynamically manage activeTab permissions based on the tab’s
current state, the content being accessed, or other custom criteria.
Sourceunsafe fn shouldBypassPermissionsForWebExtensionContext(
&self,
context: &WKWebExtensionContext,
) -> bool
Available on crate feature WKWebExtensionContext only.
unsafe fn shouldBypassPermissionsForWebExtensionContext( &self, context: &WKWebExtensionContext, ) -> bool
WKWebExtensionContext only.Called to determine if the tab should bypass host permission checks.
Parameter context: The context in which the web extension is running.
Returns: YES to bypass host permission checks, NO to enforce them.
This method allows the app to dynamically control whether a tab can bypass standard host permission checks.