Add global variable injection swicth in getHtmlBuffer