@aimeloic/monkey-tester 5.0.1 → 5.0.2

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.
Files changed (2) hide show
  1. package/htmlTemplate.js +7 -3
  2. package/package.json +1 -1
package/htmlTemplate.js CHANGED
@@ -260,7 +260,8 @@ const UI = {
260
260
  </style>
261
261
  </head>
262
262
  <body>
263
- <div id="__monkey_data__" data-payload="${endpointsJsonB64}" style="display:none;"></div>
263
+ <!-- Replace the old hidden div with this -->
264
+ <script id="__monkey_data__" type="text/plain">${endpointsJsonB64}</script>
264
265
  <header>
265
266
  <div class="logo">🐒 Endtester <span>Interactive API Hub</span></div>
266
267
  <div class="header-right">
@@ -420,7 +421,8 @@ async function handleRegister() {
420
421
  </style>
421
422
  </head>
422
423
  <body>
423
- <div id="__monkey_data__" data-payload="${endpointsJsonB64}" style="display:none;"></div>
424
+ <!-- Replace the old hidden div with this -->
425
+ <script id="__monkey_data__" type="text/plain">${endpointsJsonB64}</script>
424
426
 
425
427
  <header>
426
428
  <h1>Universal Management Dashboard</h1>
@@ -456,8 +458,10 @@ function _decode(b64) {
456
458
  return JSON.parse(decodeURIComponent(escape(atob(b64.replace(/\s+/g, '')))));
457
459
  }
458
460
 
461
+ // BEFORE (Broken)
462
+ // AFTER (Safe from HTML parsing artifacts)
459
463
  const ENDPOINTS = _decode(
460
- document.getElementById('__monkey_data__').getAttribute('data-payload')
464
+ document.getElementById('__monkey_data__').textContent.trim()
461
465
  );
462
466
 
463
467
  const token = localStorage.getItem('__auth_token__');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aimeloic/monkey-tester",
3
- "version": "5.0.1",
3
+ "version": "5.0.2",
4
4
  "description": "Auto route scanning visual runner dashboard.",
5
5
  "main": "index.js",
6
6
  "type": "module",