aboutsummaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/messages.ts1
-rw-r--r--src/shared/operations.ts26
2 files changed, 27 insertions, 0 deletions
diff --git a/src/shared/messages.ts b/src/shared/messages.ts
index 36a23d8..8032109 100644
--- a/src/shared/messages.ts
+++ b/src/shared/messages.ts
@@ -49,6 +49,7 @@ export const NAVIGATE_LINK_PREV = 'navigate.link.prev';
export interface BackgroundOperationMessage {
type: typeof BACKGROUND_OPERATION;
+ count: number;
operation: operations.Operation;
}
diff --git a/src/shared/operations.ts b/src/shared/operations.ts
index 1ce5256..67c5ca8 100644
--- a/src/shared/operations.ts
+++ b/src/shared/operations.ts
@@ -508,3 +508,29 @@ export const valueOf = (o: any): Operation => {
}
throw new TypeError('Unknown operation type: ' + o.type);
};
+
+export const isNRepeatable = (type: string): boolean => {
+ switch (type) {
+ case SCROLL_VERTICALLY:
+ case SCROLL_HORIZONALLY:
+ case SCROLL_PAGES:
+ case NAVIGATE_HISTORY_PREV:
+ case NAVIGATE_HISTORY_NEXT:
+ case NAVIGATE_PARENT:
+ case TAB_CLOSE:
+ case TAB_CLOSE_FORCE:
+ case TAB_CLOSE_RIGHT:
+ case TAB_REOPEN:
+ case TAB_PREV:
+ case TAB_NEXT:
+ case TAB_DUPLICATE:
+ case ZOOM_IN:
+ case ZOOM_OUT:
+ case URLS_PASTE:
+ case FIND_NEXT:
+ case FIND_PREV:
+ case REPEAT_LAST:
+ return true;
+ }
+ return false;
+};