Skip to content

ElectronWebviewTag

Unofficial

Electron WebviewTag for embedding external web content in the application.

Import:

import type { ElectronWebviewTag } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface ElectronWebviewTag extends HTMLElement

Extends: HTMLElement

Properties

PropertyTypeDescription
_EVENTS?{
K in keyof [HTMLElementEventMap]?: EventListenerInfo[];
}
The event listeners of the element.
(Inherited from HTMLElement)
allowpopupsbooleanWhether to allow popups.
disableblinkfeaturesstringThe Blink features to disable.
disablewebsecuritybooleanWhether to disable web security.
enableblinkfeaturesstringThe Blink features to enable.
httpreferrerstringThe HTTP referrer URL.
innerHeightnumberGet the inner height of this element without padding.
(Inherited from HTMLElement)
innerWidthnumberGet the inner width of this element without padding.
(Inherited from HTMLElement)
nodeintegrationbooleanWhether to enable Node.js integration.
nodeintegrationinsubframesbooleanWhether to enable Node.js integration in sub-frames.
partitionstringThe session partition string.
pluginsbooleanWhether to enable plugins.
preloadstringThe path to the preload script.
srcstringThe URL to load.
useragentstringThe user agent string.
webpreferencesstringThe web preferences string.

Methods

MethodReturnsDescription
addEventListener(type, listener, options?)voidRegisters an event listener.
addEventListeners(listeners)voidAdds a listener for each event named in the given map.
(Inherited from HTMLElement)
canGoBack()booleanReturns whether the webview can navigate back.
canGoForward()booleanReturns whether the webview can navigate forward.
canGoToOffset(offset)booleanReturns whether the webview can navigate to the given offset.
capturePage(rect?)Promise<ElectronNativeImage>Captures a snapshot of the page.
clearHistory()voidClears the navigation history.
closeDevTools()voidCloses the developer tools.
copy()voidCopies the selected text to the clipboard.
cut()voidCuts the selected text to the clipboard.
delete()voidDeletes the selected text.
downloadURL(url)voidInitiates a download of the resource at the given URL without navigating.
executeJavaScript(code, userGesture?)Promise<unknown>Evaluates JavaScript code in the context of the page.
findInPage(text, options?)numberStarts finding text in the page.
getTitle()stringReturns the title of the page.
getURL()stringReturns the URL of the current page.
getUserAgent()stringReturns the user agent string.
getWebContentsId()numberReturns the web contents id.
getZoomFactor()numberReturns the current zoom factor.
getZoomLevel()numberReturns the current zoom level.
goBack()voidNavigates back.
goForward()voidNavigates forward.
goToIndex(index)voidNavigates to the specified history index.
goToOffset(offset)voidNavigates to the specified history offset.
hide()voidHides the element using css display property.
(Inherited from HTMLElement)
insertCSS(css)Promise<string>Injects CSS into the page.
insertText(text)Promise<void>Inserts text at the current cursor position.
inspectElement(x, y)voidInspects the element at the given position.
inspectServiceWorker()voidOpens the developer tools for the service worker context present in the guest page.
inspectSharedWorker()voidOpens the developer tools for the shared worker context present in the guest page.
isAudioMuted()booleanReturns whether the page audio is muted.
isCrashed()booleanReturns whether the page renderer process has crashed.
isCurrentlyAudible()booleanReturns whether the page is currently producing audio.
isDevToolsFocused()booleanReturns whether the developer tools are focused.
isDevToolsOpened()booleanReturns whether the developer tools are opened.
isLoading()booleanReturns whether the page is loading resources.
isLoadingMainFrame()booleanReturns whether the main frame of the page is loading.
isShown()booleanReturns whether this element is shown, when the element is attached to the DOM and none of the parent and ancestor elements are hidden with display: none.

Exception: Does not work on <body> and <html>, or on elements with position: fixed.
(Inherited from HTMLElement)
isWaitingForResponse()booleanReturns whether the page is waiting for a first response.
loadURL(url, options?)Promise<void>Loads the given URL.
off(this, type, selector, listener, options?)voidRemoves an event listener from the element.
(Inherited from HTMLElement)
on(this, type, selector, listener, options?)voidAdds an event listener to the element.
(Inherited from HTMLElement)
onClickEvent(this, listener, options?)voidAdds a click event listener to the element.
(Inherited from HTMLElement)
onNodeInserted(this, listener, once?)() => voidAdds an event listener to the element when it is inserted into the DOM.
(Inherited from HTMLElement)
onWindowMigrated(this, listener)() => voidAdds an event listener to the element when it is migrated to another window.
(Inherited from HTMLElement)
openDevTools()voidOpens the developer tools.
paste()voidPastes from the clipboard.
pasteAndMatchStyle()voidPastes and matches the style of the current text.
print(options?)Promise<void>Prints the page.
printToPDF(options)Promise<Uint8Array>Prints the page as a PDF.
redo()voidRedoes the last undone action.
reload()voidReloads the page.
reloadIgnoringCache()voidReloads the page ignoring the cache.
removeEventListener(type, listener, options?)voidRemoves an event listener.
removeInsertedCSS(key)Promise<void>Removes previously injected CSS.
replace(text)voidReplaces the current text with the given text.
replaceMisspelling(text)voidReplaces the misspelled word with the given text.
selectAll()voidSelects all text on the page.
send(channel, args?)Promise<void>Sends an asynchronous message to the renderer process.
sendInputEvent(inputEvent)Promise<void>Sends an input event to the page.
sendToFrame(frameId, channel, args?)Promise<void>Sends a message to a specific frame in the renderer process.
setAudioMuted(muted)voidSets whether the page audio is muted.
setCssProps(props)voidSets the CSS properties of the element.
(Inherited from HTMLElement)
setCssStyles(styles)voidSets the CSS styles of the element.
(Inherited from HTMLElement)
setUserAgent(userAgent)voidSets the user agent string.
setVisualZoomLevelLimits(minimumLevel, maximumLevel)Promise<void>Sets the maximum and minimum pinch-to-zoom level.
setZoomFactor(factor)voidSets the zoom factor of the page.
setZoomLevel(level)voidSets the zoom level of the page.
show()voidShows the element using css display property.
(Inherited from HTMLElement)
showDefinitionForSelection()voidShows a pop-up dictionary that searches the selected word on the page.
stop()voidStops loading the page.
stopFindInPage(action)voidStops the find in page request.
toggle(show)voidToggles the visibility of the element using css display property.
(Inherited from HTMLElement)
toggleVisibility(visible)voidToggles the visibility of the element using css visibility property.
(Inherited from HTMLElement)
trigger(eventType)voidTriggers an event on the element.
(Inherited from HTMLElement)
undo()voidUndoes the last action.
unselect()voidClears the current selection.

Links to this page: