document.write() is dangerous, as it might overwrite the entire page

If document.write() is called once the page is fully loaded (e.g. it is not possible to use tapatalkDetect() within the immediate body, the entire HTML is discarded.

Manually creating the element has the same effect and it is no longer required to call tapatalkDetect() instantly.
Added options, templates and language variables for Tapatalk