diff --git a/build/commit_hash.js b/build/commit_hash.js index 8225817ee..2b13afb93 100644 --- a/build/commit_hash.js +++ b/build/commit_hash.js @@ -7,7 +7,9 @@ export const getCommitHash = () => { } else { try { return childProcess - .execSync('git rev-parse --short HEAD') + .execSync( + 'PATH=/usr/bin:/bin:/usr/local/bin:/sbin:/usr/sbin git rev-parse --short HEAD', + ) .toString() .trim() } catch (e) { diff --git a/src/sw.js b/src/sw.js index b7629b5f2..908e86567 100644 --- a/src/sw.js +++ b/src/sw.js @@ -198,6 +198,10 @@ self.addEventListener('push', async (event) => { self.addEventListener('message', async (event) => { await setSettings() const { type, content } = event.data + if (self.location.origin !== event.origin) { + console.error('SW Message with strange origin received', event) + return + } if (type === 'desktopNotification') { const { title, ...rest } = content