@livx.cc/iab-escape 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Elya Livshitz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,64 @@
1
- # Temporary Holding Version
1
+ # @livx.cc/iab-escape
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Move a user from the Facebook / Instagram in-app browser (IAB) to the device default browser. Zero dependencies, no logging, no analytics. Triggers mirror the ones tested on real devices.
4
+
5
+ ## Proven matrix
6
+
7
+ Tested 2026-11-16, organic links (not paid ads). The app always shows its own confirm dialog: the user taps once.
8
+
9
+ | App | OS | Scheme | Trigger tested | Result |
10
+ |---|---|---|---|---|
11
+ | Instagram 455.0.0.35.67 | iOS 26.7.3 | `instagram://extbrowser/?url=<enc>` | `<a>`, tap, and sync `location.href` while parsing (3/3 each) | Safari |
12
+ | Facebook 587.0.0.31.71 | iOS 26.7.3 | `x-safari-https://host/path` | `<a>`/tap (3/3); `setTimeout(1500)` from an inline script (3/3); sync firing while parsing fails | Safari |
13
+ | Facebook 587.0.0.39.55 | Android 16 | `intent://host/path#Intent;scheme=https;end` | `<a>`/tap: 1 run each; sync `location.href` while parsing: 3/3 | Chrome (default browser) |
14
+
15
+ Unproven, returned only with `includeUnproven: true`: Instagram Android (intent), Threads iOS (`barcelona://extbrowser`), Messenger iOS (`x-safari-https`).
16
+
17
+ ## Usage
18
+
19
+ It reopens the **same URL** in the default browser. In a normal browser it does nothing.
20
+
21
+ Script tag, placed early in the page (no code):
22
+
23
+ ```html
24
+ <script src="iab-escape.min.js" data-auto></script>
25
+ ```
26
+
27
+ Optional attributes: `data-delay-ms`, `data-mark-param` (empty = off), `data-include-unproven`, `data-url`.
28
+
29
+ npm:
30
+
31
+ ```ts
32
+ import { IabEscape } from '@livx.cc/iab-escape';
33
+
34
+ const esc = new IabEscape();
35
+ esc.auto(); // once per page load
36
+ esc.bindLink(document.querySelector('a#open')!); // fallback button/link
37
+ ```
38
+
39
+ The script build also exposes the global `IabEscape` class (`IabEscape.version`, `IabEscape.buildTime`). The ESM import has no side effects.
40
+
41
+ **Call `auto()` from an inline script**, as the probes did. If the document is still `loading`, it waits for `DOMContentLoaded` (never `load`), because navigating mid-parse leaves a half-loaded page when the user comes back (seen on Android Facebook). Then delay 0 fires synchronously and a longer delay starts a timer. If the document is already `interactive`/`complete`, the delay counts from the `auto()` call. So it fires at `DOMContentLoaded` at the earliest; on iOS Facebook the 1.5 s counts from then or from the call, whichever is later.
42
+
43
+ - `detect()` returns `{ app, os, inApp }`; `getRule()` the matrix row (with `testedOn`); `buildUrl()` the scheme URL or null.
44
+ - `escape()` fires now (call inside a tap for buttons). `auto()` returns a cancel function; cancelling before the fire re-arms the once-per-page guard (flag on the window, shared by all instances).
45
+ - `auto()` does nothing when the current page URL already carries the mark param (loop guard); `escape()` still works.
46
+ - Options: `url` (relative resolves against the page), `userAgent`, `delayMs`, `includeUnproven`, `markParam` (default `iab_escaped`, appended raw as `=1` only if absent, query otherwise byte-identical; `null` disables), `onAttempt`, `onResult`, `window`.
47
+
48
+ ## Limits
49
+
50
+ - The schemes are undocumented by Meta and an app update can break them: keep a fallback link and monitor.
51
+ - `data-auto` uses the same `auto()` path (unit-tested); the device runs used the inline `auto()` call.
52
+ - A bare `?iab_escaped` (no value) counts as "mark present": the URL is left untouched and `auto()` is skipped.
53
+ - Paid-ad clicks are untested (organic links only).
54
+ - A production domain with universal links may open the native app instead of the browser.
55
+ - Instagram passes no `fbclid` from a DM; Facebook rewrites the `fbclid` at the hand-off.
56
+ - Slow or heavy pages, and a late `auto()` call (after `load`, e.g. an SPA mount), are untested on devices.
57
+ - Matched by the rules but untested: Instagram on iPad, Facebook Lite, `http` targets on Android (`scheme=http`) and Instagram. On iOS Facebook `http` targets return null.
58
+ - Never uses meta refresh: it loops on Android when the user cancels.
59
+ - `onResult` watches `visibilitychange`/`pagehide` for 3 s. Meta webviews do not fire these reliably, so `stayed-or-unknown` is not proof of failure.
60
+ - The app's confirm dialog cannot be skipped.
61
+
62
+ ## Dev
63
+
64
+ `bun test`, `bun run build`. Open `demo/index.html` via a static server after building.
@@ -0,0 +1,56 @@
1
+ import { type Env } from './detect';
2
+ import { type Rule } from './matrix';
3
+ export type { Env, Rule };
4
+ export interface AttemptInfo {
5
+ rule: Rule;
6
+ url: string;
7
+ }
8
+ export interface ResultInfo extends AttemptInfo {
9
+ /** 'stayed-or-unknown' is NOT proof of failure: Meta webviews do not fire visibilitychange/pagehide reliably. */
10
+ outcome: 'left' | 'stayed-or-unknown';
11
+ }
12
+ export declare class IabEscapeOptions {
13
+ /** Target URL; relative values resolve against the current location. Default: current location.href. */
14
+ url: string | null;
15
+ /** Default: navigator.userAgent. */
16
+ userAgent: string | null;
17
+ /** Overrides the per-rule delay used by auto(). */
18
+ delayMs: number | null;
19
+ includeUnproven: boolean;
20
+ /** Query param appended as `=1` to the target so the landing page can tell. null disables. */
21
+ markParam: string | null;
22
+ onAttempt: ((info: AttemptInfo) => void) | null;
23
+ onResult: ((info: ResultInfo) => void) | null;
24
+ /** Injectable for tests. Default: globalThis.window. */
25
+ window: Window | null;
26
+ }
27
+ /** Maps `data-*` attributes of a script tag (dataset keys) to options. Absent or invalid values are ignored. */
28
+ export declare function optionsFromDataset(d: Record<string, string | undefined>): Partial<IabEscapeOptions>;
29
+ export declare class IabEscape {
30
+ options?: Partial<IabEscapeOptions> | undefined;
31
+ /** Package version (injected at build time). */
32
+ static readonly version: string;
33
+ /** ISO build time (injected at build time), or null. */
34
+ static readonly buildTime: string | null;
35
+ constructor(options?: Partial<IabEscapeOptions> | undefined);
36
+ private get o();
37
+ private get win();
38
+ detect(): Env;
39
+ getRule(): Rule | null;
40
+ buildUrl(): string | null;
41
+ /** Resolves the target (relative `url` against the current location); the query is never re-serialized. */
42
+ private target;
43
+ /** Fire now. Call inside a user gesture when wired to a button. */
44
+ escape(): boolean;
45
+ /**
46
+ * Fires escape() at most once per page load (flag on the window, shared by all instances).
47
+ * While the document is still `loading`, waits for DOMContentLoaded first (never `load`); then delay 0 fires
48
+ * synchronously, otherwise setTimeout. Never meta refresh (it loops on Android).
49
+ * No-op when the current page URL already carries the mark param (loop guard).
50
+ * Returns a cancel fn; cancelling before the fire re-arms the guard (StrictMode-safe).
51
+ */
52
+ auto(): () => void;
53
+ /** Plain `<a>` tap path (proven on all three). Leaves the element untouched when there is no rule. */
54
+ bindLink(a: HTMLAnchorElement): boolean;
55
+ private watch;
56
+ }
@@ -0,0 +1,201 @@
1
+ // src/detect.ts
2
+ var APPS = [
3
+ ["threads", /Barcelona/],
4
+ ["instagram", /Instagram/],
5
+ ["messenger", /FBAN\/MessengerForiOS|FB_IAB\/MESSENGER|Orca/],
6
+ ["facebook", /FBAN|FBAV|FB_IAB/]
7
+ ];
8
+ function detectEnv(ua) {
9
+ const app = APPS.find(([, re]) => re.test(ua))?.[0] ?? null;
10
+ const os = /iPhone|iPad|iPod/.test(ua) ? "ios" : /Android/.test(ua) ? "android" : null;
11
+ return { app, os, inApp: app !== null };
12
+ }
13
+
14
+ // src/matrix.ts
15
+ var xSafari = (t) => t.protocol === "https:" ? "x-safari-" + t.href : null;
16
+ var extbrowser = (scheme) => (t) => `${scheme}://extbrowser/?url=${encodeURIComponent(t.href)}`;
17
+ var intent = (t) => `intent://${t.noHash.replace(/^https?:\/\//i, "")}#Intent;scheme=${t.protocol.slice(0, -1)};end`;
18
+ var T = "2026-11-16";
19
+ var MATRIX = [
20
+ {
21
+ app: "instagram",
22
+ os: "ios",
23
+ proven: true,
24
+ delayMs: 0,
25
+ build: extbrowser("instagram"),
26
+ testedOn: { date: T, os: "iOS 26.7.3", app: "Instagram 455.0.0.35.67" }
27
+ },
28
+ {
29
+ app: "facebook",
30
+ os: "ios",
31
+ proven: true,
32
+ delayMs: 1500,
33
+ build: xSafari,
34
+ testedOn: { date: T, os: "iOS 26.7.3", app: "Facebook 587.0.0.31.71" }
35
+ },
36
+ {
37
+ app: "facebook",
38
+ os: "android",
39
+ proven: true,
40
+ delayMs: 0,
41
+ build: intent,
42
+ testedOn: { date: T, os: "Android 16", app: "Facebook 587.0.0.39.55" }
43
+ },
44
+ { app: "instagram", os: "android", proven: false, delayMs: 0, build: intent, testedOn: null },
45
+ { app: "threads", os: "ios", proven: false, delayMs: 0, build: extbrowser("barcelona"), testedOn: null },
46
+ { app: "messenger", os: "ios", proven: false, delayMs: 1500, build: xSafari, testedOn: null }
47
+ ];
48
+
49
+ // src/IabEscape.ts
50
+ class IabEscapeOptions {
51
+ url = null;
52
+ userAgent = null;
53
+ delayMs = null;
54
+ includeUnproven = false;
55
+ markParam = "iab_escaped";
56
+ onAttempt = null;
57
+ onResult = null;
58
+ window = null;
59
+ }
60
+ function optionsFromDataset(d) {
61
+ const o = {};
62
+ const n = d.delayMs?.trim();
63
+ if (n && Number.isFinite(Number(n)) && Number(n) >= 0)
64
+ o.delayMs = Number(n);
65
+ if (d.markParam !== undefined)
66
+ o.markParam = d.markParam === "" ? null : d.markParam;
67
+ if (d.includeUnproven !== undefined)
68
+ o.includeUnproven = true;
69
+ if (d.url)
70
+ o.url = d.url;
71
+ return o;
72
+ }
73
+ var WATCH_MS = 3000;
74
+ var FIRED = "__iabEscapeFired";
75
+ var hasParam = (url, key) => new URLSearchParams(url.split("#")[0].split("?")[1] ?? "").has(key);
76
+
77
+ class IabEscape {
78
+ options;
79
+ static version = "0.1.0";
80
+ static buildTime = "2026-11-16T18:51:51.232Z";
81
+ constructor(options) {
82
+ this.options = options;
83
+ this.options = { ...new IabEscapeOptions, ...options };
84
+ }
85
+ get o() {
86
+ return this.options;
87
+ }
88
+ get win() {
89
+ return this.o.window ?? globalThis.window;
90
+ }
91
+ detect() {
92
+ return detectEnv(this.o.userAgent ?? this.win.navigator.userAgent);
93
+ }
94
+ getRule() {
95
+ const { app, os } = this.detect();
96
+ const rule = MATRIX.find((r) => r.app === app && r.os === os);
97
+ return rule && (rule.proven || this.o.includeUnproven) ? rule : null;
98
+ }
99
+ buildUrl() {
100
+ const rule = this.getRule();
101
+ const target = rule && this.target();
102
+ return rule && target ? rule.build(target) : null;
103
+ }
104
+ target() {
105
+ const base = this.win.location.href;
106
+ const input = this.o.url ?? base;
107
+ let resolved;
108
+ try {
109
+ resolved = new URL(input, base);
110
+ } catch {
111
+ return null;
112
+ }
113
+ if (!/^https?:$/.test(resolved.protocol))
114
+ return null;
115
+ const raw = /^https?:\/\//i.test(input) ? input : resolved.href;
116
+ const h = raw.indexOf("#");
117
+ let noHash = h < 0 ? raw : raw.slice(0, h);
118
+ const hash = h < 0 ? "" : raw.slice(h);
119
+ const key = this.o.markParam;
120
+ if (key && !hasParam(noHash, key)) {
121
+ noHash += (noHash.includes("?") ? /[?&]$/.test(noHash) ? "" : "&" : "?") + key + "=1";
122
+ }
123
+ return { href: noHash + hash, noHash, protocol: resolved.protocol };
124
+ }
125
+ escape() {
126
+ const rule = this.getRule();
127
+ const url = this.buildUrl();
128
+ if (!rule || !url)
129
+ return false;
130
+ this.o.onAttempt?.({ rule, url });
131
+ this.win.location.href = url;
132
+ this.watch({ rule, url });
133
+ return true;
134
+ }
135
+ auto() {
136
+ const { win } = this;
137
+ const key = this.o.markParam;
138
+ const rule = this.getRule();
139
+ if (!rule || win[FIRED] || key && hasParam(win.location.href, key))
140
+ return () => {};
141
+ win[FIRED] = true;
142
+ const { document: doc } = win;
143
+ const delay = this.o.delayMs ?? rule.delayMs;
144
+ let done = false;
145
+ let id;
146
+ const fire = () => {
147
+ done = true;
148
+ if (!this.escape())
149
+ win[FIRED] = false;
150
+ };
151
+ const start = () => {
152
+ doc.removeEventListener("DOMContentLoaded", start);
153
+ if (delay <= 0)
154
+ fire();
155
+ else
156
+ id = win.setTimeout(fire, delay);
157
+ };
158
+ if (doc.readyState === "loading")
159
+ doc.addEventListener("DOMContentLoaded", start);
160
+ else
161
+ start();
162
+ return () => {
163
+ if (done)
164
+ return;
165
+ doc.removeEventListener("DOMContentLoaded", start);
166
+ if (id !== undefined)
167
+ win.clearTimeout(id);
168
+ win[FIRED] = false;
169
+ };
170
+ }
171
+ bindLink(a) {
172
+ const url = this.buildUrl();
173
+ if (!url)
174
+ return false;
175
+ a.href = url;
176
+ return true;
177
+ }
178
+ watch(info) {
179
+ const { win } = this;
180
+ let left = false;
181
+ const mark = () => {
182
+ left = true;
183
+ };
184
+ const onVis = () => {
185
+ if (win.document.visibilityState === "hidden")
186
+ mark();
187
+ };
188
+ win.addEventListener("pagehide", mark);
189
+ win.document.addEventListener("visibilitychange", onVis);
190
+ win.setTimeout(() => {
191
+ win.removeEventListener("pagehide", mark);
192
+ win.document.removeEventListener("visibilitychange", onVis);
193
+ this.o.onResult?.({ ...info, outcome: left ? "left" : "stayed-or-unknown" });
194
+ }, WATCH_MS);
195
+ }
196
+ }
197
+ export {
198
+ IabEscape,
199
+ IabEscapeOptions,
200
+ optionsFromDataset
201
+ };
@@ -0,0 +1,8 @@
1
+ export type App = 'facebook' | 'instagram' | 'messenger' | 'threads';
2
+ export type Os = 'ios' | 'android';
3
+ export interface Env {
4
+ app: App | null;
5
+ os: Os | null;
6
+ inApp: boolean;
7
+ }
8
+ export declare function detectEnv(ua: string): Env;
@@ -0,0 +1 @@
1
+ (()=>{var{defineProperty:d,getOwnPropertyNames:_,getOwnPropertyDescriptor:O}=Object,A=Object.prototype.hasOwnProperty;function R(e){return this[e]}var T=(e)=>{var t=(c??=new WeakMap).get(e),n;if(t)return t;if(t=d({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var o of _(e))if(!A.call(t,o))d(t,o,{get:R.bind(e,o),enumerable:!(n=O(e,o))||n.enumerable})}return c.set(e,t),t},c;var w=(e)=>e;function M(e,t){this[e]=w.bind(null,t)}var x=(e,t)=>{for(var n in t)d(e,n,{get:t[n],enumerable:!0,configurable:!0,set:M.bind(t,n)})};var P={};x(P,{boot:()=>I});var k=[["threads",/Barcelona/],["instagram",/Instagram/],["messenger",/FBAN\/MessengerForiOS|FB_IAB\/MESSENGER|Orca/],["facebook",/FBAN|FBAV|FB_IAB/]];function f(e){let t=k.find(([,o])=>o.test(e))?.[0]??null,n=/iPhone|iPad|iPod/.test(e)?"ios":/Android/.test(e)?"android":null;return{app:t,os:n,inApp:t!==null}}var m=(e)=>e.protocol==="https:"?"x-safari-"+e.href:null,b=(e)=>(t)=>`${e}://extbrowser/?url=${encodeURIComponent(t.href)}`,h=(e)=>`intent://${e.noHash.replace(/^https?:\/\//i,"")}#Intent;scheme=${e.protocol.slice(0,-1)};end`;var g=[{app:"instagram",os:"ios",proven:!0,delayMs:0,build:b("instagram"),testedOn:{date:"2026-11-16",os:"iOS 26.7.3",app:"Instagram 455.0.0.35.67"}},{app:"facebook",os:"ios",proven:!0,delayMs:1500,build:m,testedOn:{date:"2026-11-16",os:"iOS 26.7.3",app:"Facebook 587.0.0.31.71"}},{app:"facebook",os:"android",proven:!0,delayMs:0,build:h,testedOn:{date:"2026-11-16",os:"Android 16",app:"Facebook 587.0.0.39.55"}},{app:"instagram",os:"android",proven:!1,delayMs:0,build:h,testedOn:null},{app:"threads",os:"ios",proven:!1,delayMs:0,build:b("barcelona"),testedOn:null},{app:"messenger",os:"ios",proven:!1,delayMs:1500,build:m,testedOn:null}];class E{url=null;userAgent=null;delayMs=null;includeUnproven=!1;markParam="iab_escaped";onAttempt=null;onResult=null;window=null}function y(e){let t={},n=e.delayMs?.trim();if(n&&Number.isFinite(Number(n))&&Number(n)>=0)t.delayMs=Number(n);if(e.markParam!==void 0)t.markParam=e.markParam===""?null:e.markParam;if(e.includeUnproven!==void 0)t.includeUnproven=!0;if(e.url)t.url=e.url;return t}var L=3000,u="__iabEscapeFired",v=(e,t)=>new URLSearchParams(e.split("#")[0].split("?")[1]??"").has(t);class p{options;static version="0.1.0";static buildTime="2026-11-16T18:51:51.232Z";constructor(e){this.options=e;this.options={...new E,...e}}get o(){return this.options}get win(){return this.o.window??globalThis.window}detect(){return f(this.o.userAgent??this.win.navigator.userAgent)}getRule(){let{app:e,os:t}=this.detect(),n=g.find((o)=>o.app===e&&o.os===t);return n&&(n.proven||this.o.includeUnproven)?n:null}buildUrl(){let e=this.getRule(),t=e&&this.target();return e&&t?e.build(t):null}target(){let e=this.win.location.href,t=this.o.url??e,n;try{n=new URL(t,e)}catch{return null}if(!/^https?:$/.test(n.protocol))return null;let o=/^https?:\/\//i.test(t)?t:n.href,s=o.indexOf("#"),r=s<0?o:o.slice(0,s),a=s<0?"":o.slice(s),i=this.o.markParam;if(i&&!v(r,i))r+=(r.includes("?")?/[?&]$/.test(r)?"":"&":"?")+i+"=1";return{href:r+a,noHash:r,protocol:n.protocol}}escape(){let e=this.getRule(),t=this.buildUrl();if(!e||!t)return!1;return this.o.onAttempt?.({rule:e,url:t}),this.win.location.href=t,this.watch({rule:e,url:t}),!0}auto(){let{win:e}=this,t=this.o.markParam,n=this.getRule();if(!n||e[u]||t&&v(e.location.href,t))return()=>{};e[u]=!0;let{document:o}=e,s=this.o.delayMs??n.delayMs,r=!1,a,i=()=>{if(r=!0,!this.escape())e[u]=!1},l=()=>{if(o.removeEventListener("DOMContentLoaded",l),s<=0)i();else a=e.setTimeout(i,s)};if(o.readyState==="loading")o.addEventListener("DOMContentLoaded",l);else l();return()=>{if(r)return;if(o.removeEventListener("DOMContentLoaded",l),a!==void 0)e.clearTimeout(a);e[u]=!1}}bindLink(e){let t=this.buildUrl();if(!t)return!1;return e.href=t,!0}watch(e){let{win:t}=this,n=!1,o=()=>{n=!0},s=()=>{if(t.document.visibilityState==="hidden")o()};t.addEventListener("pagehide",o),t.document.addEventListener("visibilitychange",s),t.setTimeout(()=>{t.removeEventListener("pagehide",o),t.document.removeEventListener("visibilitychange",s),this.o.onResult?.({...e,outcome:n?"left":"stayed-or-unknown"})},L)}}function I(e,t,n={}){t.IabEscape=p;let o=e?.currentScript;if(o?.hasAttribute("data-auto"))new p({...y(o.dataset),...n}).auto()}if(typeof document<"u")I(document,globalThis);})();
package/dist/iife.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { type IabEscapeOptions } from './IabEscape';
2
+ /** Browser-script entry: exposes the global `IabEscape`; `<script data-auto>` runs auto() right away. */
3
+ export declare function boot(doc: Document | undefined, g: any, extra?: Partial<IabEscapeOptions>): void;
@@ -0,0 +1,26 @@
1
+ import type { App, Os } from './detect';
2
+ export interface TestedOn {
3
+ date: string;
4
+ os: string;
5
+ app: string;
6
+ }
7
+ /** The target URL, kept as the raw string (mark param already applied). */
8
+ export interface Target {
9
+ /** Full URL incl. fragment. */
10
+ href: string;
11
+ /** `href` without the fragment. */
12
+ noHash: string;
13
+ /** 'http:' | 'https:' */
14
+ protocol: string;
15
+ }
16
+ export interface Rule {
17
+ app: App;
18
+ os: Os;
19
+ proven: boolean;
20
+ /** Delay used by auto(). 0 = fire synchronously inside auto(). */
21
+ delayMs: number;
22
+ testedOn: TestedOn | null;
23
+ /** Returns the scheme URL or null when the target is not supported by this row. */
24
+ build(target: Target): string | null;
25
+ }
26
+ export declare const MATRIX: Rule[];
package/package.json CHANGED
@@ -1,6 +1,37 @@
1
1
  {
2
2
  "name": "@livx.cc/iab-escape",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Move users from the Facebook / Instagram in-app browser to the device default browser, using only trigger methods proven on real devices.",
6
+ "license": "MIT",
7
+ "author": "Elya Livshitz",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/Livshitz/iab-escape.git"
11
+ },
12
+ "homepage": "https://github.com/Livshitz/iab-escape#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/Livshitz/iab-escape/issues"
15
+ },
16
+ "keywords": ["in-app-browser", "facebook", "instagram", "webview", "deep-link", "open-in-browser"],
17
+ "sideEffects": false,
18
+ "main": "./dist/IabEscape.js",
19
+ "module": "./dist/IabEscape.js",
20
+ "types": "./dist/IabEscape.d.ts",
21
+ "exports": {
22
+ ".": { "types": "./dist/IabEscape.d.ts", "import": "./dist/IabEscape.js" },
23
+ "./iife": "./dist/iab-escape.min.js"
24
+ },
25
+ "files": ["dist", "README.md"],
26
+ "publishConfig": { "access": "public" },
27
+ "scripts": {
28
+ "build": "rm -rf dist && bun build.ts && tsc -p tsconfig.build.json",
29
+ "test": "timeout 120 bun test",
30
+ "prepublishOnly": "bun run build && bun run test",
31
+ "typecheck": "tsc --noEmit"
32
+ },
33
+ "devDependencies": {
34
+ "@types/bun": "latest",
35
+ "typescript": "^5.7.0"
36
+ }
37
+ }