fallback to looping through <script> elements if document.currentScript is not supported