Web Embeds | Electron
https://www.electronjs.org/ru/docs/latest/tutorial/web-embeds • 44 KB fetched Open original page
Web Embeds | Electron tags, tags, and WebContentsView. Каждый из них предлагает немного различную функциональность и полезны в разных ситуациях. To help you choose between these, this guide explains the differences and capabilities of each option."/> tags, tags, and WebContentsView. Каждый из них предлагает немного различную функциональность и полезны в разных ситуациях. To help you choose between these, this guide explains the differences and capabilities of each option."/>
Перейти к основному содержанию
Electron Документация API Блог Инструменты
* Electron Forge
* Electron Fiddle
Сообщество
* Управление
* Примеры
* Ресурсы
Релизы Русский
* English
* Deutsch
* Español
* Français
* 日本語
* Português
* Русский
* 中文
Поиск
* Начать
* Процессы в Electron
* Рекомендации
* Примеры
* Темный режим
* Device Access
* In-App Purchases
*
* Горячие клавиши
* Deep Links
* Desktop Launcher Actions
*
* Menus
* Многопоточность
* Нативное перемещение файла
* История навигации
* Notification (Оповещения)
* Закадровый рендеринг
* Обнаружение Online/Offline событий
* Progress Bars
* Недавние документы
*
*
* Representing Files in a BrowserWindow
*
* SpellChecker
* Web Embeds
* Taskbar Customization
*
* Window Customization
* Разработка
* Native Node Modules
* Распространение
* Тестирование и отладка
* Ссылки
* Вклад
*
* Примеры
* Web Embeds На этой странице
Web Embeds
Обзор
If you want to embed (third-party) web content in an Electron BrowserWindow , there are three options available to you: <iframe> tags, <webview> tags, and WebContentsView . Each one offers slightly different functionality and is useful in different situations. To help you choose between these, this guide explains the differences and capabilities of each option.
Iframes
Iframe в Electron ведет себя так же, как iframe в обычных браузерах. An <iframe> element in your page can show external web pages, provided that their Content Security Policy allows it. To limit the number of capabilities of a site in an <iframe> tag, it is recommended to use the sandbox attribute and only allow the capabilities you want to support.
WebViews
информация
We do not recommend you to use WebViews , as this tag undergoes dramatic architectural changes that may affect stability of your application. Consider switching to alternatives, like iframe and Electron's WebContentsView , or an architecture that avoids embedded content by design.
WebViews are based on Chromium's WebViews and are not explicitly supported by Electron. We do not guarantee that the WebView API will remain available in future versions of Electron. To use <webview> tags, you will need to set webviewTag to true in the webPreferences of your BrowserWindow .
WebView is a custom element ( <webview> ) that will only work inside Electron. They are implemented as an "out-of-process iframe". This means that all communication with the <webview> is done asynchronously using IPC. The <webview> element has many custom methods and events, similar to webContents , that provide you with greater control over the content.
Compared to an <iframe> , <webview> tends to be slightly slower but offers much greater control in loading and communicating with the third-party content and handling various events.
WebContentsView
WebContentsView s are not a part of the DOM—instead, they are created, controlled, positioned, and sized by your Main process. Using WebContentsView , you can combine and layer many pages together in the same BaseWindow .
WebContentsView s offer the greatest control over their contents, since they implement the webContents similarly to how BrowserWindow does it. However, as WebContentsView s are not elements inside the DOM, positioning them accurately with respect to DOM content requires coordination between the Main and Renderer processes.
Редактировать эту страницу
Назад
SpellChecker
Далее
Taskbar Customization
* Обзор
* Iframes
* WebViews
* WebContentsView
Документация
* Начало работы
* Справка по API
Контрольные списки
* Характеристика
* Безопасность
Инструменты
* Electron Forge
* Electron Fiddle
Сообщество
* Управление
* Ресурсы
* Discord
* Bluesky
* X
* Mastodon
* Stack Overflow
Подробнее
* GitHub
* Open Collective
* Панель управления инфраструктурой
Авторское право OpenJS Foundation и участники проекта Electron. Все права защищены. OpenJS Foundation обладает зарегистрированными товарными знаками и использует их. Список товарных знаков OpenJS Foundation приведён в нашей Политике в отношении товарных знаков и в Списке товарных знаков . Товарные знаки™ и логотипы®, не указанные в списке товарных знаков OpenJS Foundation , являются товарными знаками™ или зарегистрированными® товарными знаками их владельцев. Их использование не подразумевает какой-либо принадлежности к ним или поддержки с их стороны. The OpenJS Foundation | Условия использования | Политика конфиденциальности | Устав | Кодекс поведения | Политика в отношении товарных знаков | Список товарных знаков | Политика использования файлов cookie
Hosting and infrastructure graciously provided by
Links found on this page
- Перейти к основному содержанию [direct]
- Electron [direct]
- Документация [direct]
- API [direct]
- Блог [direct]
- Electron Forge [direct]
- Electron Fiddle [direct]
- Управление [direct]
- Примеры [direct]
- Ресурсы [direct]
- Релизы [direct]
- English [direct]
- Deutsch [direct]
- Español [direct]
- Français [direct]
- 日本語 [direct]
- Português [direct]
- 中文 [direct]
- Процессы в Electron [direct]
- Рекомендации [direct]
- Примеры [direct]
- Темный режим [direct]
- Device Access [direct]
- In-App Purchases [direct]
- Горячие клавиши [direct]
- Deep Links [direct]
- Desktop Launcher Actions [direct]
- Menus [direct]
- Многопоточность [direct]
- Нативное перемещение файла [direct]
- История навигации [direct]
- Notification (Оповещения) [direct]
- Закадровый рендеринг [direct]
- Обнаружение Online/Offline событий [direct]
- Progress Bars [direct]
- Недавние документы [direct]
- Representing Files in a BrowserWindow [direct]
- SpellChecker [direct]
- Taskbar Customization [direct]
- Window Customization [direct]
- Разработка [direct]
- Native Node Modules [direct]
- Распространение [direct]
- Тестирование и отладка [direct]
- Ссылки [direct]
- Вклад [direct]
- Content Security Policy [direct]
- sandbox attribute [direct]
- We do not recommend you to use WebViews [direct]
- WebContentsView [direct]
- BaseWindow [direct]
- Редактировать эту страницу [direct]
- Безопасность [direct]
- Discord [direct]
- Bluesky [direct]
- X [direct]
- Mastodon [direct]
- Stack Overflow [direct]
- GitHub [direct]
- Open Collective [direct]
- Панель управления инфраструктурой [direct]
- OpenJS Foundation [direct]
- Политике в отношении товарных знаков [direct]
- Списке товарных знаков [direct]
- Условия использования [direct]
- Политика конфиденциальности [direct]
- Устав [direct]
- Кодекс поведения [direct]
- Политика использования файлов cookie [direct]
|
|