diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2021-06-14 23:14:51 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2021-07-05 21:32:43 +0900 |
commit | 65cf6f0842d8d5933dc13b3767b1baf398d68cd5 (patch) | |
tree | df9a8b139fd98adb79f075ba655d1303bdf3fd1d /src/background/presenters | |
parent | caced372415a944c4297157397d0027ba629fff0 (diff) |
Implement FindNextOperator
Diffstat (limited to 'src/background/presenters')
-rw-r--r-- | src/background/presenters/FramePresenter.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/background/presenters/FramePresenter.ts b/src/background/presenters/FramePresenter.ts new file mode 100644 index 0000000..c94f8dd --- /dev/null +++ b/src/background/presenters/FramePresenter.ts @@ -0,0 +1,12 @@ +export default interface FramePresenter { + getAllFrameIds(tabId: number): Promise<Array<number>>; +} + +export class FramePresenterImpl implements FramePresenter { + async getAllFrameIds(tabId: number): Promise<Array<number>> { + const frames = await browser.webNavigation.getAllFrames({ tabId: tabId }); + return frames + .filter((f) => !f.url.startsWith("moz-extension://")) + .map((f) => f.frameId); + } +} |