@vita-mojo/devtools-protocol-js 0.0.37-devtools-android-fix-7a69b48-1114-rc.0 → 0.0.38

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.
@@ -1,80 +0,0 @@
1
- "use strict";
2
- // Bisection-friendly feature gates for the JS-emulated CDP package.
3
- //
4
- // Read once at module load from localStorage under LS_KEY.
5
- //
6
- // Behaviour:
7
- // key absent → every feature enabled (preserves original behaviour)
8
- // key = '[]' → nothing enabled (kill switch — use this baseline first)
9
- // key = '["*"]' → everything enabled (explicit)
10
- // key = ["a","b"] → only the listed features enabled
11
- // key supports wildcards: ["domain.*"] enables every domain.X
12
- //
13
- // From the WebView Console:
14
- // localStorage.setItem('__dtp_features', JSON.stringify([])); location.reload();
15
- // localStorage.setItem('__dtp_features', JSON.stringify(['ws'])); location.reload();
16
- // localStorage.removeItem('__dtp_features'); location.reload();
17
- //
18
- // Available feature names (see code that references each):
19
- // ws — open the WebSocket to the remote-debug server
20
- // patch.addEventListener — wrap EventTarget.prototype.add/removeEventListener
21
- // patch.console — wrap console.log/warn/error/...
22
- // patch.uncaught — install global uncaught error handler
23
- // observe.mutation — bind mutationObserver listeners in DOM domain
24
- // observe.stylesheet — bind stylesheet onStyleSheetAdded listener in CSS
25
- // domain.<Name> — register CDP domain handlers (Network/Page/.../Input)
26
- Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.describeFlags = exports.isEnabled = void 0;
28
- const LS_KEY = '__dtp_features';
29
- let allEnabled = true;
30
- const exact = new Set();
31
- const prefixes = [];
32
- try {
33
- if (typeof localStorage !== 'undefined') {
34
- const raw = localStorage.getItem(LS_KEY);
35
- if (raw !== null) {
36
- // Explicit configuration present — switch to strict opt-in mode.
37
- allEnabled = false;
38
- const parsed = JSON.parse(raw);
39
- if (Array.isArray(parsed)) {
40
- for (const item of parsed) {
41
- if (typeof item !== 'string')
42
- continue;
43
- if (item === '*') {
44
- allEnabled = true;
45
- }
46
- else if (item.endsWith('.*')) {
47
- prefixes.push(item.slice(0, -2));
48
- }
49
- else {
50
- exact.add(item);
51
- }
52
- }
53
- }
54
- }
55
- }
56
- }
57
- catch (_a) {
58
- // Bad JSON or LS unavailable — leave default (allEnabled = true).
59
- }
60
- function isEnabled(feature) {
61
- if (allEnabled)
62
- return true;
63
- if (exact.has(feature))
64
- return true;
65
- for (const p of prefixes) {
66
- if (feature === p || feature.startsWith(p + '.'))
67
- return true;
68
- }
69
- return false;
70
- }
71
- exports.isEnabled = isEnabled;
72
- function describeFlags() {
73
- return {
74
- allEnabled,
75
- exact: Array.from(exact),
76
- prefixes: prefixes.slice(),
77
- };
78
- }
79
- exports.describeFlags = describeFlags;
80
- //# sourceMappingURL=feature-flags.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"feature-flags.js","sourceRoot":"","sources":["../../../../../packages/devtools-protocol-js/src/lib/feature-flags.ts"],"names":[],"mappings":";AAAA,oEAAoE;AACpE,EAAE;AACF,2DAA2D;AAC3D,EAAE;AACF,aAAa;AACb,2EAA2E;AAC3E,8EAA8E;AAC9E,oDAAoD;AACpD,uDAAuD;AACvD,gEAAgE;AAChE,EAAE;AACF,4BAA4B;AAC5B,uFAAuF;AACvF,uFAAuF;AACvF,uFAAuF;AACvF,EAAE;AACF,2DAA2D;AAC3D,gFAAgF;AAChF,qFAAqF;AACrF,kEAAkE;AAClE,wEAAwE;AACxE,gFAAgF;AAChF,oFAAoF;AACpF,wFAAwF;;;AAExF,MAAM,MAAM,GAAG,gBAAgB,CAAC;AAEhC,IAAI,UAAU,GAAG,IAAI,CAAC;AACtB,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;AAChC,MAAM,QAAQ,GAAa,EAAE,CAAC;AAE9B,IAAI,CAAC;IACH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE,CAAC;QACxC,MAAM,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACzC,IAAI,GAAG,KAAK,IA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