(obj, name, callback)
| 18 | pageScript: { |
| 19 | onDocumentStart: async () => { |
| 20 | function hook(obj, name, callback) { |
| 21 | const fn = obj[name]; |
| 22 | obj[name] = function (...args) { |
| 23 | callback.apply(this, args); |
| 24 | fn.apply(this, args); |
| 25 | }; |
| 26 | return () => { |
| 27 | // restore |
| 28 | obj[name] = fn; |
| 29 | }; |
| 30 | } |
| 31 | |
| 32 | const btnId = "ufs-soundcloud-downloadBtn"; |
| 33 | const downloadBtn = document.createElement("button"); |
no outgoing calls
no test coverage detected