Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-importing jquery creates potential race condition with external jquery import #61

Open
danbgoldman opened this issue Jul 8, 2020 · 0 comments

Comments

@danbgoldman
Copy link

I ran into many odd, spurious errors when using it with a bootstrap template. Many hours of debugging later I realized this was because bootstrap uses jquery, I was using a different version, and both of these were imported before bibtex.js. Sometimes one load would complete first, other times it would complete second. The polling in checkReady cannot guarantee which one is used, and perhaps some hooks from each are used. This caused many unreproducible bugs involving tooltips, ajax, and tabs. Ensuring that the external call came first - and using the non-slim version that includes ajax - made most of these problems go away.

I appreciate the elegance of a self-contained script, but I think it hides important information from other developers!

(Also, perhaps it should be a separate issue, but I also noticed the imports of jquery and moment are missing subresource integrity attributes, which are important to avoid CDN server-side attacks. See srihash.org for more info.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant