@foxreis/tizentube 1.11.0 → 1.11.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/.gitattributes +2 -2
- package/LICENSE +674 -674
- package/README.md +24 -24
- package/dist/userScript.js +2 -2
- package/package.json +25 -25
- package/dist/announcements.js +0 -99
- package/dist/customNavBar.js +0 -66
package/package.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@foxreis/tizentube",
|
|
3
|
-
"appName": "TizenTube",
|
|
4
|
-
"version": "1.11.
|
|
5
|
-
"description": "TizenTube is an ad-free and sponsor-free solution for your favourite streaming website on your Tizen (Samsung) TVs.",
|
|
6
|
-
"packageType": "mods",
|
|
7
|
-
"websiteURL": "https://youtube.com/tv?additionalDataUrl=http%3A%2F%2Flocalhost%3A8085%2Fdial%2Fapps%2FYouTube",
|
|
8
|
-
"main": "dist/userScript.js",
|
|
9
|
-
"author": "Reis Can",
|
|
10
|
-
"serviceFile": "dist/service.js",
|
|
11
|
-
"keys": [
|
|
12
|
-
"MediaPlayPause",
|
|
13
|
-
"MediaPlay",
|
|
14
|
-
"MediaPause",
|
|
15
|
-
"MediaStop",
|
|
16
|
-
"MediaFastForward",
|
|
17
|
-
"MediaRewind",
|
|
18
|
-
"MediaTrackNext",
|
|
19
|
-
"MediaTrackPrevious"
|
|
20
|
-
],
|
|
21
|
-
"repository": {
|
|
22
|
-
"url": "https://github.com/reisxd/TizenTube"
|
|
23
|
-
},
|
|
24
|
-
"license": "GPL-3.0-only"
|
|
25
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@foxreis/tizentube",
|
|
3
|
+
"appName": "TizenTube",
|
|
4
|
+
"version": "1.11.1",
|
|
5
|
+
"description": "TizenTube is an ad-free and sponsor-free solution for your favourite streaming website on your Tizen (Samsung) TVs.",
|
|
6
|
+
"packageType": "mods",
|
|
7
|
+
"websiteURL": "https://youtube.com/tv?additionalDataUrl=http%3A%2F%2Flocalhost%3A8085%2Fdial%2Fapps%2FYouTube",
|
|
8
|
+
"main": "dist/userScript.js",
|
|
9
|
+
"author": "Reis Can",
|
|
10
|
+
"serviceFile": "dist/service.js",
|
|
11
|
+
"keys": [
|
|
12
|
+
"MediaPlayPause",
|
|
13
|
+
"MediaPlay",
|
|
14
|
+
"MediaPause",
|
|
15
|
+
"MediaStop",
|
|
16
|
+
"MediaFastForward",
|
|
17
|
+
"MediaRewind",
|
|
18
|
+
"MediaTrackNext",
|
|
19
|
+
"MediaTrackPrevious"
|
|
20
|
+
],
|
|
21
|
+
"repository": {
|
|
22
|
+
"url": "https://github.com/reisxd/TizenTube"
|
|
23
|
+
},
|
|
24
|
+
"license": "GPL-3.0-only"
|
|
25
|
+
}
|
package/dist/announcements.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { buttonItem, overlayPanelItemListRenderer, showModal } from "../ui/ytUI";
|
|
2
|
-
import { configRead } from "../config.js";
|
|
3
|
-
|
|
4
|
-
// For announcements
|
|
5
|
-
const elements = document.querySelectorAll('yt-formatted-string');
|
|
6
|
-
|
|
7
|
-
// Compare the css classes of the subtitle elements to find the class that is used in every formatted string
|
|
8
|
-
|
|
9
|
-
const classes = {};
|
|
10
|
-
|
|
11
|
-
for (let i = 0; i < elements.length; i++) {
|
|
12
|
-
const el = elements[i];
|
|
13
|
-
const classList = el.classList;
|
|
14
|
-
for (let j = 0; j < classList.length; j++) {
|
|
15
|
-
const cls = classList[j];
|
|
16
|
-
if (!classes[cls]) classes[cls] = 0;
|
|
17
|
-
classes[cls]++;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const commonClasses = Object.keys(classes);
|
|
22
|
-
|
|
23
|
-
for (let i = 0; i < document.styleSheets.length; i++) {
|
|
24
|
-
const sheet = document.styleSheets[i];
|
|
25
|
-
for (let j = 0; j < sheet.cssRules.length; j++) {
|
|
26
|
-
const rule = sheet.cssRules[j];
|
|
27
|
-
for (let k = 0; k < commonClasses.length; k++) {
|
|
28
|
-
const cls = commonClasses[k];
|
|
29
|
-
if (rule.selectorText && rule.selectorText.includes(cls)) {
|
|
30
|
-
console.log('Announcement subtitle class found:', cls, i, j, document.styleSheets[i].cssRules[j]);
|
|
31
|
-
rule.style.setProperty('white-space', 'pre-wrap', 'important');
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function getAnnouncements() {
|
|
38
|
-
return new Promise((resolve, reject) => {
|
|
39
|
-
resolve([
|
|
40
|
-
{
|
|
41
|
-
id: 1,
|
|
42
|
-
title: 'Welcome to TizenTube!',
|
|
43
|
-
message: 'Thank you for using TizenTube. Enjoy an ad-free and sponsor-free YouTube experience on your Tizen TV!'
|
|
44
|
-
}
|
|
45
|
-
])
|
|
46
|
-
});
|
|
47
|
-
return fetch('https://tizentube.6513006.xyz/announcements.json').then(response => {
|
|
48
|
-
if (!response.ok) {
|
|
49
|
-
throw new Error('Network response was not ok');
|
|
50
|
-
}
|
|
51
|
-
return response.json();
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
getAnnouncements().then(announcements => {
|
|
56
|
-
const lastCheck = configRead('lastAnnouncementCheck') || 0;
|
|
57
|
-
const announcement = announcements.find(a => a.id > lastCheck);
|
|
58
|
-
if (!announcement) return;
|
|
59
|
-
showModal(
|
|
60
|
-
{
|
|
61
|
-
title: announcement.title,
|
|
62
|
-
subtitle: announcement.message,
|
|
63
|
-
},
|
|
64
|
-
overlayPanelItemListRenderer([
|
|
65
|
-
buttonItem(
|
|
66
|
-
{ title: 'Close' },
|
|
67
|
-
{ icon: 'CLOSE' },
|
|
68
|
-
[
|
|
69
|
-
{
|
|
70
|
-
signalAction: {
|
|
71
|
-
signal: 'POPUP_BACK'
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
]
|
|
75
|
-
),
|
|
76
|
-
buttonItem({ title: 'Don\'t show again' },
|
|
77
|
-
{ icon: 'NOT_INTERESTED' },
|
|
78
|
-
[
|
|
79
|
-
{
|
|
80
|
-
setClientSettingEndpoint: {
|
|
81
|
-
settingDatas: [
|
|
82
|
-
{
|
|
83
|
-
clientSettingEnum: {
|
|
84
|
-
item: 'lastAnnouncementCheck'
|
|
85
|
-
},
|
|
86
|
-
intValue: new Date()
|
|
87
|
-
}
|
|
88
|
-
]
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
signalAction: {
|
|
93
|
-
signal: 'POPUP_BACK'
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
])
|
|
97
|
-
])
|
|
98
|
-
);
|
|
99
|
-
});
|
package/dist/customNavBar.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// Custom UI for nav bar
|
|
2
|
-
|
|
3
|
-
import { configRead } from "../config.js";
|
|
4
|
-
|
|
5
|
-
function applyPatches() {
|
|
6
|
-
debugger;
|
|
7
|
-
try {
|
|
8
|
-
if (!window._yttv) return setTimeout(applyPatches, 250);
|
|
9
|
-
if (!document.querySelector('video')) return setTimeout(applyPatches, 250);
|
|
10
|
-
const mappings = Object.values(window._yttv).find(a => a && a.mappings);
|
|
11
|
-
const YtlrGuideResponse = mappings.get('YtlrGuideResponse');
|
|
12
|
-
console.log('Patching YtlrGuideResponse for custom nav bar');
|
|
13
|
-
function YtLrGuideResponseHost() {
|
|
14
|
-
const args = Array.prototype.slice.call(arguments);
|
|
15
|
-
const isClass = /^class\s/.test(YtlrGuideResponse.toString());
|
|
16
|
-
|
|
17
|
-
function constructAsNew(ctor, argsList) {
|
|
18
|
-
if (typeof Reflect !== 'undefined' && typeof Reflect.construct === 'function') {
|
|
19
|
-
return Reflect.construct(ctor, argsList, YtLrGuideResponseHost);
|
|
20
|
-
}
|
|
21
|
-
return new YtlrGuideResponse(...argsList);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (!(this instanceof YtLrGuideResponseHost)) {
|
|
25
|
-
if (isClass) return constructAsNew(YtlrGuideResponse, args);
|
|
26
|
-
return YtlrGuideResponse.apply(this, args);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
let inst;
|
|
30
|
-
if (isClass) {
|
|
31
|
-
inst = constructAsNew(YtlrGuideResponse, args);
|
|
32
|
-
} else {
|
|
33
|
-
YtlrGuideResponse.apply(this, args);
|
|
34
|
-
inst = this;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const templateOriginal = inst.template;
|
|
38
|
-
inst.template = function () {
|
|
39
|
-
const itemsToRemove = configRead('customNavBarItemsToRemove');
|
|
40
|
-
const data = arguments[0].data
|
|
41
|
-
// data.items has guideSectionRenderer (could be more than one) which has guideSectionRenderer.items array, we need to modify guideSectionRenderer.items array
|
|
42
|
-
for (const section of data.items) {
|
|
43
|
-
section.guideSectionRenderer.items = section.guideSectionRenderer.items.filter(item => {
|
|
44
|
-
return !itemsToRemove.includes(item.guideEntryRenderer.icon.iconType);
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
return templateOriginal.apply(this, arguments);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return inst;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
YtLrGuideResponseHost.prototype = YtlrGuideResponse.prototype;
|
|
54
|
-
mappings.mappings.set('YtlrGuideResponse', YtLrGuideResponseHost);
|
|
55
|
-
}catch (e) {
|
|
56
|
-
console.error('Error applying custom nav bar patches:', e);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (document.readyState === 'complete' || document.readyState === 'interactive') {
|
|
63
|
-
applyPatches();
|
|
64
|
-
} else {
|
|
65
|
-
window.addEventListener('DOMContentLoaded', applyPatches);
|
|
66
|
-
}
|