зеркало из https://github.com/electron/electron.git
chore: remove undocumented page-title-set webview event (#34533)
This commit is contained in:
Родитель
218797eb61
Коммит
f172136752
|
@ -9,10 +9,6 @@ export interface GuestViewDelegate {
|
|||
reset(): void;
|
||||
}
|
||||
|
||||
const DEPRECATED_EVENTS: Record<string, string> = {
|
||||
'page-title-updated': 'page-title-set'
|
||||
} as const;
|
||||
|
||||
export function registerEvents (viewInstanceId: number, delegate: GuestViewDelegate) {
|
||||
ipcRendererInternal.on(`${IPC_MESSAGES.GUEST_VIEW_INTERNAL_DESTROY_GUEST}-${viewInstanceId}`, function () {
|
||||
delegate.reset();
|
||||
|
@ -20,10 +16,6 @@ export function registerEvents (viewInstanceId: number, delegate: GuestViewDeleg
|
|||
});
|
||||
|
||||
ipcRendererInternal.on(`${IPC_MESSAGES.GUEST_VIEW_INTERNAL_DISPATCH_EVENT}-${viewInstanceId}`, function (event, eventName, props) {
|
||||
if (DEPRECATED_EVENTS[eventName] != null) {
|
||||
delegate.dispatchEvent(DEPRECATED_EVENTS[eventName], props);
|
||||
}
|
||||
|
||||
delegate.dispatchEvent(eventName, props);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -566,18 +566,6 @@ describe('<webview> tag', function () {
|
|||
});
|
||||
});
|
||||
|
||||
describe('page-title-set event', () => {
|
||||
it('emits when title is set', async () => {
|
||||
loadWebView(webview, {
|
||||
src: `file://${fixtures}/pages/a.html`
|
||||
});
|
||||
const { title, explicitSet } = await waitForEvent(webview, 'page-title-set');
|
||||
|
||||
expect(title).to.equal('test');
|
||||
expect(explicitSet).to.be.true();
|
||||
});
|
||||
});
|
||||
|
||||
describe('page-favicon-updated event', () => {
|
||||
it('emits when favicon urls are received', async () => {
|
||||
loadWebView(webview, {
|
||||
|
|
Загрузка…
Ссылка в новой задаче