From 65cf6f0842d8d5933dc13b3767b1baf398d68cd5 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Mon, 14 Jun 2021 23:14:51 +0900 Subject: Implement FindNextOperator --- src/background/presenters/FramePresenter.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/background/presenters/FramePresenter.ts (limited to 'src/background/presenters') 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>; +} + +export class FramePresenterImpl implements FramePresenter { + async getAllFrameIds(tabId: number): Promise> { + const frames = await browser.webNavigation.getAllFrames({ tabId: tabId }); + return frames + .filter((f) => !f.url.startsWith("moz-extension://")) + .map((f) => f.frameId); + } +} -- cgit v1.2.3