v1.6.4/add and fix

-fix chat bug
-add viki
-fix apple tv+
This commit is contained in:
2020-08-28 12:18:35 -04:00
parent f779c1fc90
commit b5a9c8db64
7 changed files with 76 additions and 25 deletions
+4 -2
View File
@@ -20,7 +20,8 @@
"https://*.peacocktv.com/*", "https://*.peacocktv.com/*",
"https://play.google.com/movies/*", "https://play.google.com/movies/*",
"https://*.crunchyroll.com/*", "https://*.crunchyroll.com/*",
"https://tv.apple.com/*" "https://tv.apple.com/*",
"https://*.viki.com/*"
], ],
"content_security_policy": "script-src 'self' https://unpkg.com/ https://www.gstatic.com/ https://*.firebaseio.com https://www.googleapis.com; object-src 'self'", "content_security_policy": "script-src 'self' https://unpkg.com/ https://www.gstatic.com/ https://*.firebaseio.com https://www.googleapis.com; object-src 'self'",
"content_scripts": [ "content_scripts": [
@@ -36,7 +37,8 @@
"https://*.peacocktv.com/*", "https://*.peacocktv.com/*",
"https://play.google.com/*", "https://play.google.com/*",
"https://*.crunchyroll.com/*", "https://*.crunchyroll.com/*",
"https://tv.apple.com/*" "https://tv.apple.com/*",
"https://*.viki.com/*"
], ],
"run_at": "document_idle", "run_at": "document_idle",
"js": ["/static/js/content.js"], "js": ["/static/js/content.js"],
+2
View File
@@ -31,6 +31,7 @@ export const PLAYER_SOURCE = {
GOOGLEPLAY: 'play.google.', GOOGLEPLAY: 'play.google.',
CRUNCHYROLL: 'crunchyroll.', CRUNCHYROLL: 'crunchyroll.',
APPLE: 'tv.apple.', APPLE: 'tv.apple.',
VIKI: 'viki.',
LOCAL: 'localhost', LOCAL: 'localhost',
}; };
@@ -47,6 +48,7 @@ export const getPlayerSource = () => {
if (HREF.includes(PLAYER_SOURCE.GOOGLEPLAY)) return PLAYER_SOURCE.GOOGLEPLAY; if (HREF.includes(PLAYER_SOURCE.GOOGLEPLAY)) return PLAYER_SOURCE.GOOGLEPLAY;
if (HREF.includes(PLAYER_SOURCE.CRUNCHYROLL)) return PLAYER_SOURCE.CRUNCHYROLL; if (HREF.includes(PLAYER_SOURCE.CRUNCHYROLL)) return PLAYER_SOURCE.CRUNCHYROLL;
if (HREF.includes(PLAYER_SOURCE.APPLE)) return PLAYER_SOURCE.APPLE; if (HREF.includes(PLAYER_SOURCE.APPLE)) return PLAYER_SOURCE.APPLE;
if (HREF.includes(PLAYER_SOURCE.VIKI)) return PLAYER_SOURCE.VIKI;
if (HREF.includes(PLAYER_SOURCE.LOCAL)) return PLAYER_SOURCE.LOCAL; if (HREF.includes(PLAYER_SOURCE.LOCAL)) return PLAYER_SOURCE.LOCAL;
}; };
+14 -4
View File
@@ -110,10 +110,9 @@ const App = () => {
if (visible) { if (visible) {
document.body.classList.add('visible'); document.body.classList.add('visible');
PartyRoutesWrapper && PartyRoutesWrapper.classList.add('visible'); PartyRoutesWrapper && PartyRoutesWrapper.classList.add('visible');
if ( if (getPlayerSource() === PLAYER_SOURCE.HBOMAX || getPlayerSource() === PLAYER_SOURCE.HBONOW) {
!hasAttached && setTutorialComplete(true);
(getPlayerSource() === PLAYER_SOURCE.HBOMAX || getPlayerSource() === PLAYER_SOURCE.HBONOW) if (!hasAttached) {
) {
document.addEventListener( document.addEventListener(
'mousedown', 'mousedown',
function (ev) { function (ev) {
@@ -127,7 +126,18 @@ const App = () => {
); );
hasAttached = true; hasAttached = true;
} }
}
if (getPlayerSource() === PLAYER_SOURCE.APPLE) {
const appleTvPlayer = document.querySelector('apple-tv-plus-player');
const takeoverContainer = appleTvPlayer.shadowRoot.querySelector('.takeover.container.show');
if (takeoverContainer) takeoverContainer.style.maxWidth = 'var(--body-width)';
}
} else { } else {
if (getPlayerSource() === PLAYER_SOURCE.APPLE) {
const appleTvPlayer = document.querySelector('apple-tv-plus-player');
const takeoverContainer = appleTvPlayer.shadowRoot.querySelector('.takeover.container.show');
if (takeoverContainer) takeoverContainer.style.maxWidth = 'none';
}
document.body.classList.remove('visible'); document.body.classList.remove('visible');
PartyRoutesWrapper && PartyRoutesWrapper.classList.remove('visible'); PartyRoutesWrapper && PartyRoutesWrapper.classList.remove('visible');
} }
+1 -1
View File
@@ -195,7 +195,7 @@ export default class Thread extends Component {
return ( return (
<AutoSizer style={{ flex: 1 }}> <AutoSizer style={{ flex: 1 }}>
{({ height, width }) => { {({ height, width }) => {
if (autoSizeWidth && autoSizeWidth !== width) { if (autoSizeWidth !== width) {
cache.clearAll(); cache.clearAll();
this.listRef.current.recomputeRowHeights(); this.listRef.current.recomputeRowHeights();
this.setState({ autoSizeWidth: width }); this.setState({ autoSizeWidth: width });
+38 -4
View File
@@ -134,6 +134,9 @@ export default class VideoListener {
case PLAYER_SOURCE.APPLE: case PLAYER_SOURCE.APPLE:
this.video.element.currentTime = serverPlayer.time; this.video.element.currentTime = serverPlayer.time;
break; break;
case PLAYER_SOURCE.VIKI:
this.video.element.currentTime = serverPlayer.time;
break;
default: default:
break; break;
} }
@@ -276,11 +279,19 @@ export default class VideoListener {
const appleTvPlayer = document.querySelector('apple-tv-plus-player'); const appleTvPlayer = document.querySelector('apple-tv-plus-player');
const appleTvInternal = appleTvPlayer.shadowRoot.querySelector('amp-video-player-internal'); const appleTvInternal = appleTvPlayer.shadowRoot.querySelector('amp-video-player-internal');
const appleTvVideoContainer = appleTvInternal.shadowRoot.querySelector('amp-video-player'); const appleTvVideoContainer = appleTvInternal.shadowRoot.querySelector('amp-video-player');
const appleTvShow = appleTvVideoContainer.querySelector(nS.show).innerText || '';
const appleTvEpisode = appleTvVideoContainer.querySelector(nS.episode).innerText || ''; const appleTvShowContainer = appleTvVideoContainer.querySelector(nS.show);
const appleTvEpisodeContainer = appleTvVideoContainer.querySelector(nS.episode);
const appleTvShow = appleTvShowContainer ? appleTvShowContainer.innerText : '';
const appleTvEpisode = appleTvEpisodeContainer ? appleTvEpisodeContainer.innerText : '';
return appleTvShow === '' && appleTvEpisode === '' return appleTvShow === '' && appleTvEpisode === ''
? null ? null
: appleTvShow + '\n' + appleTvEpisode; : appleTvShow + '\n' + appleTvEpisode;
case PLAYER_SOURCE.VIKI:
const docTitleSplit = document.title.split('|');
if (docTitleSplit.length > 1) return docTitleSplit[0].trim();
else return null;
default: default:
break; break;
} }
@@ -599,9 +610,14 @@ export default class VideoListener {
const ati = atp.shadowRoot.querySelector('amp-video-player-internal'); const ati = atp.shadowRoot.querySelector('amp-video-player-internal');
const atv = ati.shadowRoot.querySelector('amp-video-player'); const atv = ati.shadowRoot.querySelector('amp-video-player');
const atve = atv.shadowRoot.querySelector(this.selectors[PLAYER_SOURCE.APPLE]); const atve = atv.shadowRoot.querySelector(this.selectors[PLAYER_SOURCE.APPLE]);
if (atve) {
const tc = atp.shadowRoot.querySelector('.takeover.container.show'); const tc = atp.shadowRoot.querySelector('.takeover.container.show');
if (tc) tc.style.maxWidth = 'var(--body-width)'; const visible = document.querySelector('body.visible');
if (tc && visible) tc.style.maxWidth = 'var(--body-width)';
else if (tc && !visible) tc.style.maxWidth = 'none';
if (
!!atve === true &&
(!!this.video.element === false || atve !== this.video.element)
) {
this.firstTimeSync(atve); this.firstTimeSync(atve);
} }
}, },
@@ -609,6 +625,24 @@ export default class VideoListener {
); );
} }
break; break;
case PLAYER_SOURCE.VIKI:
const vikiVideoElement = document.querySelector(this.selectors[PLAYER_SOURCE.VIKI]);
if (vikiVideoElement) {
this.firstTimeSync(vikiVideoElement);
} else {
setInterval(
this.video.element
? null
: () => {
var vve = document.querySelector(this.selectors[PLAYER_SOURCE.VIKI]);
if (vve !== null && (this.video.element !== vve || this.video.element === null)) {
this.firstTimeSync(vve);
}
},
1000
);
}
break;
case PLAYER_SOURCE.LOCAL: case PLAYER_SOURCE.LOCAL:
const localVideoElement = document.getElementsByTagName('video')[0]; const localVideoElement = document.getElementsByTagName('video')[0];
if (localVideoElement) { if (localVideoElement) {
+1 -1
View File
@@ -77,7 +77,7 @@ body.disney.visible #hudson-wrapper, /* DISNEY */
body.youtube.visible #content.ytd-app, /* YOUTUBE */ body.youtube.visible #content.ytd-app, /* YOUTUBE */
body.youtube.visible #masthead-container, /* YOUTUBE HEADER */ body.youtube.visible #masthead-container, /* YOUTUBE HEADER */
body.googleplay.visible div.llhEMd.bYEzqc.LAhoGb.iWO5td, /* GOOGLE PLAY MOVIES */ body.googleplay.visible div.llhEMd.bYEzqc.LAhoGb.iWO5td, /* GOOGLE PLAY MOVIES */
body.apple.visible .container.takeover.show /* APPLE TV */ { body.viki.visible div.video-player /* VIKI */ {
max-width: var(--body-width) !important; max-width: var(--body-width) !important;
} }
/* HULU MINIMIZED VIDEO */ /* HULU MINIMIZED VIDEO */
+3
View File
@@ -97,6 +97,9 @@ switch (getPlayerSource()) {
case PLAYER_SOURCE.APPLE: case PLAYER_SOURCE.APPLE:
document.body.classList.add('apple'); document.body.classList.add('apple');
break; break;
case PLAYER_SOURCE.VIKI:
document.body.classList.add('viki');
break;
case PLAYER_SOURCE.LOCAL: case PLAYER_SOURCE.LOCAL:
document.body.classList.add('local'); document.body.classList.add('local');
break; break;