v1.6.6/release- chat fix- hbo click fix- hbo resize
This commit is contained in:
+51
-53
@@ -12,18 +12,18 @@ COPIED, EDITED, OR REPRODUCED WITHOUT PERMISSION.
|
||||
/* global chrome */
|
||||
/* global firebase */
|
||||
|
||||
const APP_VERSION = "1.6.5";
|
||||
const APP_VERSION_STRING = APP_VERSION.replace(/\./g, "");
|
||||
const APP_VERSION = '1.6.6';
|
||||
const APP_VERSION_STRING = APP_VERSION.replace(/\./g, '');
|
||||
|
||||
const firebaseConfig = {
|
||||
apiKey: "AIzaSyCJLuYpzXLDRmu2ttzFuSGmYcpFxqToWFU",
|
||||
authDomain: "watch-party-crx.firebaseapp.com",
|
||||
databaseURL: "https://watch-party-crx.firebaseio.com",
|
||||
projectId: "watch-party-crx",
|
||||
storageBucket: "watch-party-crx.appspot.com",
|
||||
messagingSenderId: "712242707190",
|
||||
appId: "1:712242707190:web:65fa7f772e30da364b0ad7",
|
||||
measurementId: "G-EZS4PEVG4T",
|
||||
apiKey: 'AIzaSyCJLuYpzXLDRmu2ttzFuSGmYcpFxqToWFU',
|
||||
authDomain: 'watch-party-crx.firebaseapp.com',
|
||||
databaseURL: 'https://watch-party-crx.firebaseio.com',
|
||||
projectId: 'watch-party-crx',
|
||||
storageBucket: 'watch-party-crx.appspot.com',
|
||||
messagingSenderId: '712242707190',
|
||||
appId: '1:712242707190:web:65fa7f772e30da364b0ad7',
|
||||
measurementId: 'G-EZS4PEVG4T',
|
||||
};
|
||||
|
||||
firebase.initializeApp(firebaseConfig);
|
||||
@@ -44,8 +44,8 @@ const fetcher = async (request, sendResponse) => {
|
||||
method,
|
||||
headers: {
|
||||
Authorization: `Token ${idToken}:${firebase.auth().currentUser.uid}`,
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
"Keep-Alive": true,
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
'Keep-Alive': true,
|
||||
},
|
||||
...request,
|
||||
})
|
||||
@@ -73,37 +73,37 @@ const sendAuth = async (sendResponse) => {
|
||||
|
||||
chrome.runtime.onInstalled.addListener((details) => {
|
||||
if (details.reason) {
|
||||
if (details.reason === "install") {
|
||||
if (window.localStorage.getItem("watchPartyVersion")) {
|
||||
if (window.localStorage.getItem("watchPartyVersion") !== APP_VERSION) {
|
||||
if (details.reason === 'install') {
|
||||
if (window.localStorage.getItem('watchPartyVersion')) {
|
||||
if (window.localStorage.getItem('watchPartyVersion') !== APP_VERSION) {
|
||||
chrome.tabs.create({
|
||||
url: `http://www.chromewatchparty.com/changes/v${APP_VERSION}`,
|
||||
active: true,
|
||||
});
|
||||
window.localStorage.setItem("watchPartyVersion", APP_VERSION);
|
||||
window.localStorage.setItem('watchPartyVersion', APP_VERSION);
|
||||
}
|
||||
} else {
|
||||
chrome.tabs.create({
|
||||
url: "https://www.chromewatchparty.com/welcome",
|
||||
url: 'https://www.chromewatchparty.com/welcome',
|
||||
active: true,
|
||||
});
|
||||
window.localStorage.setItem("watchPartyVersion", APP_VERSION);
|
||||
window.localStorage.setItem('watchPartyVersion', APP_VERSION);
|
||||
}
|
||||
} else if (details.reason === "update") {
|
||||
if (window.localStorage.getItem("watchPartyVersion")) {
|
||||
if (window.localStorage.getItem("watchPartyVersion") !== APP_VERSION) {
|
||||
} else if (details.reason === 'update') {
|
||||
if (window.localStorage.getItem('watchPartyVersion')) {
|
||||
if (window.localStorage.getItem('watchPartyVersion') !== APP_VERSION) {
|
||||
chrome.tabs.create({
|
||||
url: `http://www.chromewatchparty.com/changes/v${APP_VERSION}`,
|
||||
active: true,
|
||||
});
|
||||
window.localStorage.setItem("watchPartyVersion", APP_VERSION);
|
||||
window.localStorage.setItem('watchPartyVersion', APP_VERSION);
|
||||
}
|
||||
} else {
|
||||
chrome.tabs.create({
|
||||
url: `http://www.chromewatchparty.com/changes/v${APP_VERSION}`,
|
||||
active: true,
|
||||
});
|
||||
window.localStorage.setItem("watchPartyVersion", APP_VERSION);
|
||||
window.localStorage.setItem('watchPartyVersion', APP_VERSION);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,41 +112,41 @@ chrome.runtime.onInstalled.addListener((details) => {
|
||||
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
||||
const { type } = request;
|
||||
switch (type) {
|
||||
case "API_CALL":
|
||||
case 'API_CALL':
|
||||
fetcher(request, sendResponse);
|
||||
break;
|
||||
case "GET_AUTH":
|
||||
case 'GET_AUTH':
|
||||
sendAuth(sendResponse);
|
||||
break;
|
||||
case "GET_PARTIES":
|
||||
case 'GET_PARTIES':
|
||||
sendResponse(
|
||||
window.localStorage.getItem("parties")
|
||||
? JSON.parse(window.localStorage.getItem("parties"))
|
||||
window.localStorage.getItem('parties')
|
||||
? JSON.parse(window.localStorage.getItem('parties'))
|
||||
: []
|
||||
);
|
||||
break;
|
||||
case "EMPTY_PARTIES":
|
||||
window.localStorage.removeItem("parties");
|
||||
case 'EMPTY_PARTIES':
|
||||
window.localStorage.removeItem('parties');
|
||||
break;
|
||||
case "IS_HIDDEN":
|
||||
case 'IS_HIDDEN':
|
||||
sendResponse(
|
||||
window.localStorage.getItem("showWPButton")
|
||||
? JSON.parse(window.localStorage.getItem("showWPButton"))
|
||||
window.localStorage.getItem('showWPButton')
|
||||
? JSON.parse(window.localStorage.getItem('showWPButton'))
|
||||
: true
|
||||
);
|
||||
break;
|
||||
case "GET_TUTORIAL":
|
||||
case 'GET_TUTORIAL':
|
||||
sendResponse(
|
||||
window.localStorage.getItem("tutorialComplete")
|
||||
? JSON.parse(window.localStorage.getItem("tutorialComplete"))
|
||||
window.localStorage.getItem('tutorialComplete')
|
||||
? JSON.parse(window.localStorage.getItem('tutorialComplete'))
|
||||
: false
|
||||
);
|
||||
break;
|
||||
case "SET_TUTORIAL":
|
||||
window.localStorage.setItem("tutorialComplete", request.status);
|
||||
case 'SET_TUTORIAL':
|
||||
window.localStorage.setItem('tutorialComplete', request.status);
|
||||
break;
|
||||
default:
|
||||
console.warn("Unknown message type: <", type, ">");
|
||||
console.warn('Unknown message type: <', type, '>');
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
@@ -160,10 +160,10 @@ chrome.runtime.onConnect.addListener((port) => {
|
||||
});
|
||||
port.onMessage.addListener((request) => {
|
||||
const { type, roomId, roomPin } = request;
|
||||
if (type === "INIT") {
|
||||
if (type === 'INIT') {
|
||||
port.roomListener = firebase
|
||||
.firestore()
|
||||
.collection("rooms")
|
||||
.collection('rooms')
|
||||
.doc(roomId)
|
||||
.onSnapshot(
|
||||
(snap) => {
|
||||
@@ -177,16 +177,14 @@ chrome.runtime.onConnect.addListener((port) => {
|
||||
);
|
||||
port.userListener = firebase
|
||||
.firestore()
|
||||
.collection("rooms")
|
||||
.collection('rooms')
|
||||
.doc(roomId)
|
||||
.collection("users")
|
||||
.collection('users')
|
||||
.onSnapshot(
|
||||
(snap) => {
|
||||
if (snap) {
|
||||
const isAdmin = snap.docs
|
||||
.filter(
|
||||
(user) => user.id === firebase.auth().currentUser.uid
|
||||
)[0]
|
||||
.filter((user) => user.id === firebase.auth().currentUser.uid)[0]
|
||||
.data().admin;
|
||||
const users = snap.docs.map((userSnap) => userSnap.data().name);
|
||||
port.postMessage({ admin: isAdmin, users });
|
||||
@@ -198,10 +196,10 @@ chrome.runtime.onConnect.addListener((port) => {
|
||||
);
|
||||
port.messageListener = firebase
|
||||
.firestore()
|
||||
.collection("rooms")
|
||||
.collection('rooms')
|
||||
.doc(roomId)
|
||||
.collection("messages")
|
||||
.orderBy("time")
|
||||
.collection('messages')
|
||||
.orderBy('time')
|
||||
.onSnapshot(
|
||||
(snap) => {
|
||||
if (snap) {
|
||||
@@ -215,18 +213,18 @@ chrome.runtime.onConnect.addListener((port) => {
|
||||
port.postMessage({ isError: true, ...err });
|
||||
}
|
||||
);
|
||||
if (window.localStorage.getItem("parties")) {
|
||||
var existing = JSON.parse(window.localStorage.getItem("parties"));
|
||||
if (window.localStorage.getItem('parties')) {
|
||||
var existing = JSON.parse(window.localStorage.getItem('parties'));
|
||||
if (!(existing.filter((i) => i.name === roomId).length > 0)) {
|
||||
existing.push({
|
||||
name: roomId,
|
||||
pin: roomPin,
|
||||
});
|
||||
window.localStorage.setItem("parties", JSON.stringify(existing));
|
||||
window.localStorage.setItem('parties', JSON.stringify(existing));
|
||||
}
|
||||
} else {
|
||||
window.localStorage.setItem(
|
||||
"parties",
|
||||
'parties',
|
||||
JSON.stringify([
|
||||
{
|
||||
name: roomId,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "Watch Party",
|
||||
"short_name": "WP",
|
||||
"version": "1.6.5",
|
||||
"version": "1.6.6",
|
||||
"description": "Watch streamed content together.",
|
||||
"background": {
|
||||
"page": "background.html"
|
||||
|
||||
Reference in New Issue
Block a user