@livx.cc/appwrap 0.48.0 → 0.48.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livx.cc/appwrap",
3
- "version": "0.48.0",
3
+ "version": "0.48.1",
4
4
  "description": "Wrap any PWA into a native app with native capabilities (appwrap runtime + @livx.cc/native-kit).",
5
5
  "license": "MIT",
6
6
  "author": "Elya Livshitz",
@@ -37,6 +37,24 @@ window.__APPWRAP_DEBUG__=${SHELL_CONFIG.debug ? 'true' : 'false'};
37
37
  });
38
38
  window.addEventListener('error', function(e){ post('[uncaught] ' + (e.message || e) + ' @ ' + (e.filename || '') + ':' + (e.lineno || 0)); });
39
39
  window.addEventListener('unhandledrejection', function(e){ var r = e.reason; post('[rejection] ' + ((r && (r.stack || r.message)) || r)); });
40
+ // Debug builds only: a loud, non-interactive DEV strip pinned to the top edge showing the server
41
+ // this shell points at. A dev-pointing ipa (debug:true) must never be mistaken for a store/prod
42
+ // build — the host in the strip makes "which backend am I on?" answerable at a glance.
43
+ var srv = ${JSON.stringify(SHELL_CONFIG.serverUrl || '')};
44
+ var host = ''; try { host = srv ? new URL(srv).host : (location && location.host) || ''; } catch (e) { host = srv || ''; }
45
+ function mountDevStrip(){
46
+ if (document.getElementById('__appwrap_dev_strip__') || !document.body) return;
47
+ var el = document.createElement('div');
48
+ el.id = '__appwrap_dev_strip__';
49
+ el.textContent = 'DEV · ' + host;
50
+ el.style.cssText = 'position:fixed;top:0;left:0;right:0;z-index:2147483647;pointer-events:none;'
51
+ + 'background:#b91c1c;color:#fff;text-align:center;letter-spacing:.5px;'
52
+ + 'font:600 10px/1 -apple-system,system-ui,sans-serif;'
53
+ + 'padding:calc(env(safe-area-inset-top,0px) + 2px) 6px 2px;';
54
+ document.body.appendChild(el);
55
+ }
56
+ if (document.body) mountDevStrip();
57
+ else document.addEventListener('DOMContentLoaded', mountDevStrip);
40
58
  })();`;
41
59
 
42
60
  /**