mekytsc110 1.1.0
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/.github/workflows/publish.yml +22 -0
- package/inject.js +122 -0
- package/package.json +19 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: Pubblicazione su NPM
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
publish:
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
steps:
|
|
10
|
+
- name: Scarica il codice
|
|
11
|
+
uses: actions/checkout@v4
|
|
12
|
+
|
|
13
|
+
- name: Configura Node.js
|
|
14
|
+
uses: actions/setup-node@v4
|
|
15
|
+
with:
|
|
16
|
+
node-version: 'lts/*'
|
|
17
|
+
registry-url: 'https://registry.npmjs.org'
|
|
18
|
+
|
|
19
|
+
- name: Pubblica su NPM
|
|
20
|
+
run: npm publish --access public
|
|
21
|
+
env:
|
|
22
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/inject.js
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
(function () {
|
|
2
|
+
console.log("[TizenNetflix FINAL] INIT");
|
|
3
|
+
|
|
4
|
+
var items = [];
|
|
5
|
+
var currentIndex = 0;
|
|
6
|
+
var initialized = false;
|
|
7
|
+
|
|
8
|
+
// ======================
|
|
9
|
+
// STYLE
|
|
10
|
+
// ======================
|
|
11
|
+
var style = document.createElement('style');
|
|
12
|
+
style.innerHTML = `
|
|
13
|
+
* { cursor: none !important; }
|
|
14
|
+
|
|
15
|
+
.tizen-focus {
|
|
16
|
+
outline: 4px solid #00aaff !important;
|
|
17
|
+
transform: scale(1.08) !important;
|
|
18
|
+
transition: 0.2s;
|
|
19
|
+
z-index: 99999 !important;
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
document.head.appendChild(style);
|
|
23
|
+
|
|
24
|
+
// ======================
|
|
25
|
+
// GET ITEMS
|
|
26
|
+
// ======================
|
|
27
|
+
function getItems() {
|
|
28
|
+
var imgs = Array.from(document.querySelectorAll("img"));
|
|
29
|
+
var valid = [];
|
|
30
|
+
|
|
31
|
+
for (var i = 0; i < imgs.length; i++) {
|
|
32
|
+
var link = imgs[i].closest("a");
|
|
33
|
+
if (link) valid.push(link);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return valid;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// ======================
|
|
40
|
+
// INIT
|
|
41
|
+
// ======================
|
|
42
|
+
function init(itemsFound) {
|
|
43
|
+
items = itemsFound;
|
|
44
|
+
initialized = true;
|
|
45
|
+
|
|
46
|
+
console.log("[TizenNetflix FINAL] READY:", items.length);
|
|
47
|
+
|
|
48
|
+
focus(0);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// ======================
|
|
52
|
+
// WAIT LOOP (CRUCIALE)
|
|
53
|
+
// ======================
|
|
54
|
+
function waitLoop() {
|
|
55
|
+
var found = getItems();
|
|
56
|
+
|
|
57
|
+
console.log("[WAIT] items:", found.length);
|
|
58
|
+
|
|
59
|
+
if (!initialized && found.length > 20) {
|
|
60
|
+
init(found);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
setTimeout(waitLoop, 1500);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// ======================
|
|
67
|
+
// FOCUS
|
|
68
|
+
// ======================
|
|
69
|
+
function focus(index) {
|
|
70
|
+
if (!items.length) return;
|
|
71
|
+
|
|
72
|
+
for (var i = 0; i < items.length; i++) {
|
|
73
|
+
items[i].classList.remove("tizen-focus");
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (index < 0) index = 0;
|
|
77
|
+
if (index >= items.length) index = items.length - 1;
|
|
78
|
+
|
|
79
|
+
currentIndex = index;
|
|
80
|
+
|
|
81
|
+
var el = items[currentIndex];
|
|
82
|
+
el.classList.add("tizen-focus");
|
|
83
|
+
|
|
84
|
+
try { el.scrollIntoView({ block: "center" }); } catch (e) {}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// ======================
|
|
88
|
+
// NAV
|
|
89
|
+
// ======================
|
|
90
|
+
function moveRight() { focus(currentIndex + 1); }
|
|
91
|
+
function moveLeft() { focus(currentIndex - 1); }
|
|
92
|
+
function moveDown() { focus(currentIndex + 5); }
|
|
93
|
+
function moveUp() { focus(currentIndex - 5); }
|
|
94
|
+
|
|
95
|
+
// ======================
|
|
96
|
+
// CLICK
|
|
97
|
+
// ======================
|
|
98
|
+
function select() {
|
|
99
|
+
var el = items[currentIndex];
|
|
100
|
+
if (el) el.click();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// ======================
|
|
104
|
+
// KEYS
|
|
105
|
+
// ======================
|
|
106
|
+
document.addEventListener("keydown", function (e) {
|
|
107
|
+
if (!initialized) return;
|
|
108
|
+
|
|
109
|
+
var key = e.key;
|
|
110
|
+
|
|
111
|
+
if (key === "ArrowRight") { e.preventDefault(); moveRight(); }
|
|
112
|
+
else if (key === "ArrowLeft") { e.preventDefault(); moveLeft(); }
|
|
113
|
+
else if (key === "ArrowDown") { e.preventDefault(); moveDown(); }
|
|
114
|
+
else if (key === "ArrowUp") { e.preventDefault(); moveUp(); }
|
|
115
|
+
else if (key === "Enter") { e.preventDefault(); select(); }
|
|
116
|
+
else if (key === "Backspace") { window.history.back(); }
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
// START
|
|
120
|
+
waitLoop();
|
|
121
|
+
|
|
122
|
+
})();
|
package/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mekytsc110",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Ottimizzazione TV ed AdBlock per StreamingCommunity su Tizen OS",
|
|
5
|
+
"packageType": "mods",
|
|
6
|
+
"appName": "StreamingCommunity TV",
|
|
7
|
+
"websiteURL": "https://streamingcommunityz.band/",
|
|
8
|
+
"main": "inject.js",
|
|
9
|
+
"evaluateScriptOnDocumentStart": true,
|
|
10
|
+
"keys": [
|
|
11
|
+
"ArrowUp",
|
|
12
|
+
"ArrowDown",
|
|
13
|
+
"ArrowLeft",
|
|
14
|
+
"ArrowRight",
|
|
15
|
+
"Enter",
|
|
16
|
+
"Return",
|
|
17
|
+
"GoBack"
|
|
18
|
+
]
|
|
19
|
+
}
|