Skip to content

Commit

Permalink
Fix as in #21 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore committed Nov 11, 2020
1 parent c02ba6c commit 49ce1f4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/dom/performance/jquery.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
(function() {
'use strict';

var versions = [];
const versions = [];
// check that we got a jQuery
if (typeof window.jQuery === 'function') {
// https://github.com/sitespeedio/coach-core/issues/21#issuecomment-717041439
let keepRef = window.$;
versions.push(window.jQuery.fn.jquery);
var old = window.jQuery;
let old = window.jQuery;
while (old.fn && old.fn.jquery) {
old = window.jQuery.noConflict(true);
if (!window.jQuery || !window.jQuery.fn) {
Expand All @@ -16,6 +18,7 @@
}
versions.push(window.jQuery.fn.jquery);
}
window.$ = keepRef;
}

// TODO also add check for jQuery version. If we have a really old version (1 year old?) then show it!
Expand Down

0 comments on commit 49ce1f4

Please sign in to comment.