tizenbrew-module 1.0.2 → 1.0.4

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/index.js +7 -20
  2. package/package.json +3 -4
package/index.js CHANGED
@@ -1,20 +1,12 @@
1
1
  (function () {
2
- // If the module is executed in the TizenBrew menu, force-launch the browser
3
- if (window.location.href.indexOf('net22.cc') === -1) {
4
- try {
5
- // Create a fake link to force the TV to open the native browser
6
- var a = document.createElement('a');
7
- a.href = 'https://net22.cc';
8
- a.target = '_blank';
9
- document.body.appendChild(a);
10
- a.click();
11
- } catch (e) {
12
- window.location.href = 'https://net22.cc';
13
- }
14
- return; // Stop script execution in the menu.
2
+ // Inject the CSS dynamically because TizenBrew 'mods' packages only inject the main JS file.
3
+ var css = '* { cursor: none !important; } ::-webkit-scrollbar { display: none !important; } html, body { -ms-overflow-style: none !important; scrollbar-width: none !important; } :focus, .tizen-focus { outline: none !important; border: 5px solid #00ffcc !important; transform: scale(1.1) !important; box-shadow: 0 0 20px 5px rgba(0, 255, 204, 0.8) !important; transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease !important; z-index: 9999 !important; border-radius: 8px; background-color: rgba(0, 255, 204, 0.1) !important; } .focusable { transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease; }';
4
+ var styleNode = document.createElement('style');
5
+ styleNode.innerHTML = css;
6
+ if (document.head) {
7
+ document.head.appendChild(styleNode);
15
8
  }
16
9
 
17
- // Wrapped in an IIFE to prevent variable collisions in TizenBrew's global scope
18
10
  var KEY_ENTER = 13;
19
11
  var KEY_UP = 38;
20
12
  var KEY_DOWN = 40;
@@ -26,7 +18,7 @@
26
18
 
27
19
  var focusableElements = [];
28
20
  var currentFocusIndex = -1;
29
-
21
+
30
22
  function updateFocusableElements() {
31
23
  try {
32
24
  var nodeList = document.querySelectorAll(FOCUSABLE_SELECTORS);
@@ -219,19 +211,14 @@
219
211
  }
220
212
  });
221
213
 
222
- // Replace MutationObserver completely with a safe setInterval
223
- // This is incredibly robust for older TVs, prevents any infinite DOM loops,
224
- // and doesn't rely on the MutationObserver API existing.
225
214
  setInterval(function () {
226
215
  updateFocusableElements();
227
216
  }, 1500);
228
217
 
229
- // Initial check
230
218
  window.addEventListener('load', function () {
231
219
  updateFocusableElements();
232
220
  });
233
221
 
234
- // Failsafe execution
235
222
  updateFocusableElements();
236
223
 
237
224
  })();
package/package.json CHANGED
@@ -1,14 +1,13 @@
1
1
  {
2
2
  "name": "tizenbrew-module",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Custom TV remote mapping for net22.cc",
5
5
  "main": "index.js",
6
- "style": "style.css",
7
6
  "author": "Netmirror",
8
7
  "packageType": "mods",
9
8
  "appName": "Net22 Player",
10
9
  "title": "Net22 Player",
11
- "websiteURL": "*://*.net22.cc/*",
10
+ "websiteURL": "https://net22.cc/",
12
11
  "keys": [
13
12
  "ArrowUp",
14
13
  "ArrowDown",
@@ -17,4 +16,4 @@
17
16
  "Enter",
18
17
  "Return"
19
18
  ]
20
- }
19
+ }