Last active
September 23, 2023 20:04
Prevent soundcloud signup popup when scrubbing
This file contains hidden or 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
javascript:LOOP:for(const e of webpackJsonp){let o=e[1];for(let n of Object.keys(o)){let t=o[n].toString();if(-1!==t.indexOf("shouldBlockScrubbing:function")){webpackJsonp.push([[],{[n]:function(o){o.exports={shouldBlockScrubbing:()=>!1,pauseAndPromptSignup(){}}}}]);break LOOP}}} |
This file contains hidden or 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
// Discover which module number it comes from by iterating over all of them | |
LOOP: for (const e of webpackJsonp) { | |
const obj = e[1]; | |
for (const k of Object.keys(obj)) { | |
// check whether the function source contains our target function | |
const fn = obj[k].toString(); | |
if (fn.indexOf('shouldBlockScrubbing:function') !== -1) { | |
// Now inject a new module with the same ID | |
webpackJsonp.push([[], { | |
[k]: function(mod) { | |
mod.exports = { | |
shouldBlockScrubbing: () => false, | |
pauseAndPromptSignup: () => {} | |
}; | |
}}]); | |
break LOOP; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment