Skip to content

Commit

Permalink
chore: remove undocumented page-title-set webview event (#34533)
Browse files Browse the repository at this point in the history
  • Loading branch information
miniak committed Jun 22, 2022
1 parent 218797e commit f172136
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 f172136

Please sign in to comment.