Skip to content

Commit

Permalink
Add linkClickIntercepted to FrameElementDelegate
Browse files Browse the repository at this point in the history
Expand the `FrameElementDelegate` interface to include a
`linkClickIntercepted` to match its existing
`formSubmissionIntercepted`, then replace a manual `setAttribute` and
`src` assignment with a delegation to the `FrameElementDelegate`
instance.
  • Loading branch information
seanpdoyle committed Nov 9, 2021
1 parent 7b54d10 commit 4511889
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/core/frames/frame_redirector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ export class FrameRedirector implements LinkInterceptorDelegate, FormInterceptor
linkClickIntercepted(element: Element, url: string) {
const frame = this.findFrameElement(element)
if (frame) {
frame.setAttribute("reloadable", "")
frame.src = url
frame.delegate.linkClickIntercepted(element, url)
}
}

Expand Down
1 change: 1 addition & 0 deletions src/elements/frame_element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface FrameElementDelegate {
sourceURLChanged(): void
disabledChanged(): void
formSubmissionIntercepted(element: HTMLFormElement, submitter?: HTMLElement): void
linkClickIntercepted(element: Element, url: string): void
loadResponse(response: FetchResponse): void
isLoading: boolean
}
Expand Down

0 comments on commit 4511889

Please sign in to comment.