v1.6.6/release- chat fix- hbo click fix- hbo resize
This commit is contained in:
+21
-7
@@ -14,6 +14,7 @@ import ReactDOM from 'react-dom';
|
||||
import firebase from 'firebase/app';
|
||||
import App from './App';
|
||||
import './index.css';
|
||||
import 'react-virtualized/styles.css';
|
||||
import { PLAYER_SOURCE, getPlayerSource } from './Api';
|
||||
|
||||
const firebaseConfig = {
|
||||
@@ -64,9 +65,6 @@ switch (getPlayerSource()) {
|
||||
{ capture: true }
|
||||
);
|
||||
document.body.classList.add('hulu');
|
||||
const ds = document.createElement('script');
|
||||
ds.text = `window.doquery=function(){window.huluPlayer=window.queryObjects(window.HuluMediaPlayer);}`;
|
||||
document.head.appendChild(ds);
|
||||
break;
|
||||
case PLAYER_SOURCE.AMAZON:
|
||||
document.body.classList.add('amazon-prime');
|
||||
@@ -79,11 +77,27 @@ switch (getPlayerSource()) {
|
||||
break;
|
||||
case PLAYER_SOURCE.HBONOW:
|
||||
case PLAYER_SOURCE.HBOMAX:
|
||||
const hboClickInject = `var hboInputFix=function(ev){if(ev.target.tagName==='INPUT'||ev.target.tagName==='TEXTAREA'){ev.target.focus();}ev.stopImmediatePropagation();ev.stopPropagation();};document.addEventListener('keydown',hboInputFix,{capture:true});var hboClickFix=function(ev){if(document.querySelector('body.visible')){if(ev.clientX > window.innerWidth - (parseInt(document.documentElement.style.getPropertyValue('--party-width').slice(0,-2)) + 50) ){if(ev.target.tagName==='INPUT'||ev.target.tagName==='TEXTAREA'){ev.target.focus();}ev.preventDefault();ev.stopPropagation();ev.stopImmediatePropagation();}}};document.addEventListener("mousedown",hboClickFix,{capture:true});`;
|
||||
const hboClickInjectScript = document.createElement('script');
|
||||
hboClickInjectScript.text = hboClickInject;
|
||||
document.head.appendChild(hboClickInjectScript);
|
||||
document.body.classList.add('hbo');
|
||||
window.addEventListener(
|
||||
'mousedown',
|
||||
(ev) => {
|
||||
const partyWrapper = document.querySelector('#party_wrapper');
|
||||
const tutorialWrapper = document.querySelector('.watch-party-tutorial');
|
||||
if (
|
||||
(partyWrapper && partyWrapper.contains(ev.target)) ||
|
||||
(tutorialWrapper && tutorialWrapper.contains(ev.target))
|
||||
) {
|
||||
if (ev.target.id !== 'party-width-dragger') {
|
||||
ev.stopImmediatePropagation();
|
||||
ev.preventDefault();
|
||||
}
|
||||
if (ev.target.tagName === 'INPUT' || ev.target.tagName === 'TEXTAREA') {
|
||||
ev.target.focus();
|
||||
}
|
||||
}
|
||||
},
|
||||
{ capture: true }
|
||||
);
|
||||
break;
|
||||
case PLAYER_SOURCE.PEACOCK:
|
||||
document.body.classList.add('peacock');
|
||||
|
||||
Reference in New Issue
Block a user