Skip to content

Instantly share code, notes, and snippets.

@simon816
Last active September 23, 2023 20:04
Show Gist options
  • Save simon816/b45b40cfeb0f45cf79566885791f0471 to your computer and use it in GitHub Desktop.
Save simon816/b45b40cfeb0f45cf79566885791f0471 to your computer and use it in GitHub Desktop.
Prevent soundcloud signup popup when scrubbing
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}}}
// 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