fix js globals and snippets