diff --git a/functions/index.js b/functions/index.js index d85ebea..1f5ad67 100644 --- a/functions/index.js +++ b/functions/index.js @@ -385,7 +385,7 @@ const updatePlayer = async (req, res) => { uid: '', name: '', text: `${userName} changed show to \n${player.showName}`, - time: new Date().toISOString(), + time: new Date(), }); } if (roomData.status !== player.status) { diff --git a/public/background.js b/public/background.js index 9aafcbd..93412a4 100644 --- a/public/background.js +++ b/public/background.js @@ -108,11 +108,12 @@ chrome.runtime.onConnect.addListener((port) => { .collection('rooms') .doc(roomId) .collection('messages') - .orderBy('time') .onSnapshot( (snap) => { if (snap) - port.postMessage({ messages: snap.docs.map((v) => ({ ...v.data(), id: v.id })) }); + port.postMessage({ + messages: snap.docs.map((v) => ({ ...v.data(), id: v.id })), + }); }, (err) => { port.postMessage({ isError: true, ...err }); diff --git a/public/manifest.json b/public/manifest.json index e4b6bc5..8d4df38 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -6,7 +6,12 @@ "background": { "page": "popup.html" }, - "permissions": ["https://*.hulu.com/*", "https://*.netflix.com/*", "https://*.amazon.com/*"], + "permissions": [ + "https://*.hulu.com/*", + "https://*.netflix.com/*", + "https://*.amazon.com/*", + "https://*.disneyplus.com/*" + ], "content_security_policy": "script-src 'self' https://www.gstatic.com/ https://*.firebaseio.com https://www.googleapis.com; object-src 'self'", "content_scripts": [ { @@ -26,6 +31,12 @@ "run_at": "document_idle", "js": ["/static/js/content.js"], "css": ["/static/css/app.css"] + }, + { + "matches": ["https://*.disneyplus.com/*"], + "run_at": "document_idle", + "js": ["/static/js/content.js"], + "css": ["/static/css/app.css"] } ], "web_accessible_resources": ["android-icon-192x192.png"], diff --git a/src/Api.js b/src/Api.js index 9eecb0a..b024490 100644 --- a/src/Api.js +++ b/src/Api.js @@ -14,6 +14,7 @@ export const PLAYER_SOURCE = { NETFLIX: 'https://www.netflix.', AMAZON: 'https://www.amazon.', HULU: 'https://www.hulu.', + DISNEY: 'https://www.disneyplus.', LOCAL: 'http://localhost', }; @@ -22,6 +23,7 @@ export const getPlayerSource = () => { if (HREF.startsWith(PLAYER_SOURCE.NETFLIX)) return PLAYER_SOURCE.NETFLIX; if (HREF.startsWith(PLAYER_SOURCE.HULU)) return PLAYER_SOURCE.HULU; if (HREF.startsWith(PLAYER_SOURCE.AMAZON)) return PLAYER_SOURCE.AMAZON; + if (HREF.startsWith(PLAYER_SOURCE.DISNEY)) return PLAYER_SOURCE.DISNEY; if (HREF.startsWith(PLAYER_SOURCE.LOCAL)) return PLAYER_SOURCE.LOCAL; }; diff --git a/src/Chat.js b/src/Chat.js index dfa3639..e433dd6 100644 --- a/src/Chat.js +++ b/src/Chat.js @@ -115,6 +115,7 @@ export default class Chat extends Component { showName, time, source, + updatedBy: window.localStorage.getItem('watchPartyUserUid'), }, }).catch((err) => { this.props.updateLoading(false); @@ -235,13 +236,15 @@ export default class Chat extends Component { {admin && ( )}
- + new Date(b).getTime() - new Date(a).getTime())} + />
{ value={joinName} className="card-field addFocus" onChange={(e) => setJoinName(e.target.value)} - label="Party Name" + label="Party Code" + helperText="Ask your party leader for this code" />