webext-messenger 0.22.0-2 → 0.22.0-4

Sign up to get free protection for your applications and to get access to all the features.
@@ -44,7 +44,7 @@ export function once(function_) {
44
44
  let called = false;
45
45
  let returnValue;
46
46
  return function (...arguments_) {
47
- if (called) {
47
+ if (!called) {
48
48
  returnValue = function_.apply(this, arguments_);
49
49
  called = true;
50
50
  }
@@ -1,5 +1,5 @@
1
- import { AnyTarget, Message, MessengerMeta, Sender } from "./types.js";
1
+ import { AnyTarget, KnownTarget, Message, MessengerMeta, Sender } from "./types.js";
2
2
  export declare function getActionForMessage(from: Sender, message: Message): "respond" | "forward" | "ignore";
3
3
  export declare function __getTabData(this: MessengerMeta): AnyTarget;
4
- export declare function getThisTarget(): Promise<AnyTarget>;
4
+ export declare function getThisTarget(): Promise<KnownTarget>;
5
5
  export declare function initPrivateApi(): void;
@@ -52,6 +52,11 @@ export interface AnyTarget {
52
52
  frameId?: number;
53
53
  page?: string;
54
54
  }
55
+ export interface KnownTarget {
56
+ tabId?: number;
57
+ frameId?: number;
58
+ page: string;
59
+ }
55
60
  export interface Target {
56
61
  tabId: number;
57
62
  frameId?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webext-messenger",
3
- "version": "0.22.0-2",
3
+ "version": "0.22.0-4",
4
4
  "description": "Browser Extension component messaging framework",
5
5
  "keywords": [],
6
6
  "repository": "pixiebrix/webext-messenger",