Also note the use of _call.call(_toString, original) rather than simply original.toString(). This is because original.toString might itself be hooked by the time spoof is called. By holding cached references to Function.prototype.call and Function.prototype.toString at the very beginning of the script (before any page code runs), and invoking them via those cached references, the spoof function is immune to any tampering that might have happened in the interim. It’s eating its own tail in the most delightful way.
Multi-platform scheduling
。Line官方版本下载是该领域的重要参考
My response was to abandon trying to intercept at the level of individual elements and instead intercept at the level of the browser’s own property descriptors. I went straight for HTMLMediaElement.prototype with Object.getOwnPropertyDescriptor, hooking the native src and srcObject setters before any page code could run:
Что думаешь? Оцени!
圖像來源,Getty Images