Focus / youtubequality

https://chrome.google.com/webstore/detail/your-quality-for-youtube/nfcilgimggemnogfigihdkmapdhhlbph
Apache License 2.0
10 stars 11 forks source link

why inject with document.body.appendChild #1

Closed robbiemu closed 10 years ago

robbiemu commented 10 years ago

this is a question not a bug.

Why does the yt.js inject code like <script>foo</script> into the document with document.body.appendChild ? Isn't there some way to directly use that code like:

      var fileref=document.createElement('script')
      fileref.setAttribute("type","text/javascript")
      fileref.setAttribute("src", filename)
      document.getElementsByTagName("head")[0].appendChild(fileref)
Focus commented 10 years ago

Sorry the previous answer was a ton of rubbish. I have made similar changes to what you suggest here.