v1.4.1-beta/HBO Fixes
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "watch-party-crx",
|
||||
"version": "1.4.0",
|
||||
"version": "1.4.1",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@giphy/js-fetch-api": "^1.5.8",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "Watch Party",
|
||||
"short_name": "WP",
|
||||
"version": "1.4.0",
|
||||
"version": "1.4.1",
|
||||
"description": "Watch streamed content together.",
|
||||
"background": {
|
||||
"page": "popup.html"
|
||||
|
||||
+30
-1
@@ -6,7 +6,7 @@ import Loading from './Loading';
|
||||
import firebase from 'firebase/app';
|
||||
import 'firebase/firestore';
|
||||
import Inactive from './Inactive';
|
||||
import { getUserUid } from './Api';
|
||||
import { getUserUid, getPlayerSource, PLAYER_SOURCE } from './Api';
|
||||
|
||||
const APP_VERSION = '1.4.0';
|
||||
|
||||
@@ -22,6 +22,15 @@ const darkTheme = createMuiTheme({
|
||||
},
|
||||
});
|
||||
|
||||
function hboClickFix(ev) {
|
||||
if (document.querySelector('body.visible')) {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
ev.stopImmediatePropagation();
|
||||
console.log('cc');
|
||||
}
|
||||
}
|
||||
|
||||
const Routes = (props) => (
|
||||
<Router>
|
||||
<Create {...props} />
|
||||
@@ -40,6 +49,8 @@ const App = () => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [notification, setNotification] = useState(closedNotification);
|
||||
|
||||
let hasAttached = false;
|
||||
|
||||
useEffect(() => {
|
||||
setLoading(true);
|
||||
getUserUid();
|
||||
@@ -58,6 +69,24 @@ const App = () => {
|
||||
if (visible) {
|
||||
document.body.classList.add('visible');
|
||||
PartyRoutesWrapper && PartyRoutesWrapper.classList.add('visible');
|
||||
if (
|
||||
!hasAttached &&
|
||||
(getPlayerSource() === PLAYER_SOURCE.HBOMAX || getPlayerSource() === PLAYER_SOURCE.HBONOW)
|
||||
) {
|
||||
document.addEventListener(
|
||||
'mousedown',
|
||||
function (ev) {
|
||||
if (document.body.querySelector('body.visible')) {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
ev.stopImmediatePropagation();
|
||||
console.log('cc');
|
||||
}
|
||||
},
|
||||
{ capture: true }
|
||||
);
|
||||
hasAttached = true;
|
||||
}
|
||||
} else {
|
||||
document.body.classList.remove('visible');
|
||||
PartyRoutesWrapper && PartyRoutesWrapper.classList.remove('visible');
|
||||
|
||||
@@ -55,6 +55,10 @@ 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 - 400){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');
|
||||
break;
|
||||
case PLAYER_SOURCE.LOCAL:
|
||||
|
||||
Reference in New Issue
Block a user