Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Commit

Permalink
chore: remove undocumented page-title-set webview event (electron#34533)
Browse files Browse the repository at this point in the history
  • Loading branch information
miniak authored and khalwa committed Feb 22, 2023
1 parent 22b1559 commit 9a58066
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
8 changes: 0 additions & 8 deletions lib/renderer/web-view/guest-view-internal.ts
Expand Up @@ -9,21 +9,13 @@ 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();
delegate.dispatchEvent('destroyed', {});
});

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);
});
}
Expand Down
12 changes: 0 additions & 12 deletions spec/webview-spec.js
Expand Up @@ -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, {
Expand Down

0 comments on commit 9a58066

Please sign in to comment.