From 8c0d306823063e9f4f267c9b16b4a6eb2cf6e234 Mon Sep 17 00:00:00 2001 From: chylex <contact@chylex.com> Date: Mon, 28 Aug 2017 20:05:49 +0200 Subject: [PATCH] Rewrite sound notification hook to be hopefully more reliable --- Resources/Scripts/code.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Resources/Scripts/code.js b/Resources/Scripts/code.js index b961b700..1f003383 100644 --- a/Resources/Scripts/code.js +++ b/Resources/Scripts/code.js @@ -426,13 +426,9 @@ // // Block: Hook into the notification sound effect. // - (function(){ - let soundEle = document.getElementById("update-sound"); - - soundEle.play = prependToFunction(soundEle.play, function(){ - return $TDX.muteNotifications || $TDX.hasCustomNotificationSound; - }); - })(); + HTMLAudioElement.prototype.play = prependToFunction(HTMLAudioElement.prototype.play, function(){ + return $TDX.muteNotifications || $TDX.hasCustomNotificationSound; + }); // // Block: Update highlighted column and tweet for context menu and other functionality.