Last active
December 30, 2015 18:51
-
-
Save ewnd9/465c3837705fd71f6e42 to your computer and use it in GitHub Desktop.
disable-vk-player snippet for preventing accidentally moving to next track
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var superFn; | |
var mockFn = function(id) { | |
if (id === window.audioPlayer.id) { | |
superFn(id); | |
} | |
}; | |
if (window.playAudioNew.toString() !== mockFn.toString()) { | |
superFn = window.playAudioNew; | |
window.playAudioNew = mockFn; | |
console.log('activated'); | |
} else { | |
window.playAudioNew = superFn; | |
console.log('disactivated'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment