Skip to content

Instantly share code, notes, and snippets.

@shaomingquan
Created August 21, 2020 02:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shaomingquan/0aa5ee3cc5af11d5904d33de32b860c3 to your computer and use it in GitHub Desktop.
Save shaomingquan/0aa5ee3cc5af11d5904d33de32b860c3 to your computer and use it in GitHub Desktop.
var oldHeadAppend = HTMLHeadElement.prototype.appendChild
HTMLHeadElement.prototype.appendChild = function () {
var args = [].slice.call(arguments)
var child = args[0]
if (child instanceof HTMLScriptElement) {
child.src = child.src + ('?ts=' + Date.now())
}
return oldHeadAppend.apply(this, args)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment