pinokiod 5.3.16 → 5.3.18

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": "pinokiod",
3
- "version": "5.3.16",
3
+ "version": "5.3.18",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -2679,6 +2679,51 @@ const refreshParent = (e) => {
2679
2679
  }
2680
2680
  } catch (_) {}
2681
2681
  }
2682
+
2683
+ if (typeof window !== 'undefined' && !window.__pinokioNavigateListenerInstalled) {
2684
+ try {
2685
+ window.__pinokioNavigateListenerInstalled = true;
2686
+ } catch (_) {}
2687
+ window.addEventListener('message', (event) => {
2688
+ if (!event || !event.data || event.data.e !== 'pinokio:navigate') return;
2689
+ try {
2690
+ console.info('[pinokio:navigate] received', { origin: event.origin, url: event.data?.url });
2691
+ } catch (_) {}
2692
+ const frame = document.activeElement;
2693
+ if (!frame || frame.tagName !== 'IFRAME') {
2694
+ try {
2695
+ console.warn('[pinokio:navigate] no active iframe');
2696
+ } catch (_) {}
2697
+ return;
2698
+ }
2699
+ const rawUrl = typeof event.data.url === 'string' ? event.data.url : '';
2700
+ if (!rawUrl) {
2701
+ try {
2702
+ console.warn('[pinokio:navigate] empty url');
2703
+ } catch (_) {}
2704
+ return;
2705
+ }
2706
+ let target;
2707
+ try {
2708
+ target = new URL(rawUrl, window.location.origin);
2709
+ } catch (_) {
2710
+ try {
2711
+ console.warn('[pinokio:navigate] invalid url', rawUrl);
2712
+ } catch (_) {}
2713
+ return;
2714
+ }
2715
+ if (target.origin !== window.location.origin) {
2716
+ try {
2717
+ console.warn('[pinokio:navigate] blocked origin', target.origin);
2718
+ } catch (_) {}
2719
+ return;
2720
+ }
2721
+ frame.src = target.toString();
2722
+ try {
2723
+ console.info('[pinokio:navigate] navigated', frame.src);
2724
+ } catch (_) {}
2725
+ });
2726
+ }
2682
2727
  let tippyInstances = [];
2683
2728
  const COMPACT_LAYOUT_QUERY = '(max-width: 768px)';
2684
2729
  const compactLayoutMedia = window.matchMedia(COMPACT_LAYOUT_QUERY);
@@ -2,6 +2,7 @@
2
2
  <head>
3
3
  <meta charset="UTF-8">
4
4
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
5
+ <link href="/style.css" rel="stylesheet"/>
5
6
  <style>
6
7
  body {
7
8
  }
@@ -158,7 +159,6 @@ body main iframe {
158
159
  <link href="/css/solid.min.css" rel="stylesheet">
159
160
  <link href="/css/regular.min.css" rel="stylesheet">
160
161
  <link href="/css/brands.min.css" rel="stylesheet">
161
- <link href="/style.css" rel="stylesheet"/>
162
162
  <% if (agent === "electron") { %>
163
163
  <link href="/electron.css" rel="stylesheet"/>
164
164
  <% } %>